Create age settings

createAgeSettings(
  includeAge = FALSE,
  ageKnots = 5,
  allowRegularization = FALSE,
  computeConfidenceIntervals = FALSE,
  minAge = NULL,
  maxAge = NULL
)

Arguments

includeAge

Should age be included in the model?

ageKnots

If a single number is provided this is assumed to indicate the number of knots to use for the spline, and the knots are automatically spaced according to equal percentiles of the data. If more than one number is provided these are assumed to be the exact location of the knots in age-days

allowRegularization

When fitting the model, should the covariates defined here be allowed to be regularized?

computeConfidenceIntervals

Should confidence intervals be computed for the covariates defined here? Setting this to FALSE might save computing time when fitting the model. Will be turned to FALSE automaticaly when allowRegularization = TRUE.

minAge

Minimum age at which patient time will be included in the analysis. Note that information prior to the min age is still used to determine exposure status after the minimum age (e.g. when a prescription was started just prior to reaching the minimum age). Also, outcomes occurring before the minimum age is reached will be considered as prior outcomes when using first outcomes only. Age should be specified in years, but non-integer values are allowed. If not specified, no age restriction will be applied.

maxAge

Maximum age at which patient time will be included in the analysis. Age should be specified in years, but non-integer values are allowed. If not specified, no age restriction will be applied.

Value

An object of type ageSettings.

Details

Create an object specifying whether and how age should be included in the model. Age can be included by splitting patient time into calendar months. During a month, the relative risk attributed to age is assumed to be constant, and the risk from month to month is modeled using a cubic spline.