createCalendarTimeCovariateSettings: Create calendar time settings

View source: R/CovariateSettings.R

createCalendarTimeCovariateSettingsR Documentation

Create calendar time settings

Description

Create calendar time settings

Usage

createCalendarTimeCovariateSettings(
  calendarTimeKnots = 5,
  allowRegularization = FALSE,
  computeConfidenceIntervals = FALSE
)

Arguments

calendarTimeKnots

If a single number is provided this is assumed to indicate the number of knots to use for the spline. See details on how knots are placed. If a series of dates is provided these are assumed to be the exact location of the knots.

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 automatically when allowRegularization = TRUE.

Details

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

Whereas the seasonality covariate uses a cyclic spline, repeating every year, this calendar time covariate can model trends over years.

If a number of knots is specified, knots are automatically spaced according to equal percentiles of the data (people observed). If more than one study period is provided, two more knots (start and end) are automatically added for each additional study period. So if calendarTimeKnots = 5 and there are 3 study periods, the total number of knots will be 5 + 2 * (3 - 1) = 9.#'

Value

An object of type seasonalitySettings.


OHDSI/SelfControlledCaseSeries documentation built on Jan. 31, 2024, 7:30 p.m.