createRestrictPlpDataSettings define extra restriction settings when calling getPlpData
Source:R/ExtractData.R
createRestrictPlpDataSettings.Rd
This function creates the settings used to restrict the target cohort when calling getPlpData
Usage
createRestrictPlpDataSettings(
studyStartDate = "",
studyEndDate = "",
firstExposureOnly = FALSE,
washoutPeriod = 0,
sampleSize = NULL
)
Arguments
- studyStartDate
A calendar date specifying the minimum date that a cohort index date can appear. Date format is 'yyyymmdd'.
- studyEndDate
A calendar date specifying the maximum date that a cohort index date can appear. Date format is 'yyyymmdd'. Important: the study end data is also used to truncate risk windows, meaning no outcomes beyond the study end date will be considered.
- firstExposureOnly
Should only the first exposure per subject be included? Note that this is typically done in the
createStudyPopulation
function, but can already be done here for efficiency reasons.- washoutPeriod
The mininum required continuous observation time prior to index date for a person to be included in the at risk cohort. Note that this is typically done in the
createStudyPopulation
function, but can already be done here for efficiency reasons.- sampleSize
If not NULL, the number of people to sample from the target cohort
Value
A setting object of class restrictPlpDataSettings
containing a list of
the settings:
studyStartDate
: A calendar date specifying the minimum date that a cohort index date can appearstudyEndDate
: A calendar date specifying the maximum date that a cohort index date can appearfirstExposureOnly
: Should only the first exposure per subject be includedwashoutPeriod
: The mininum required continuous observation time prior to index date for a person to be included in the at risk cohortsampleSize
: If not NULL, the number of people to sample from the target cohort
Examples
# restrict to 2010, first exposure only, require washout period of 365 day
# and sample 1000 people
createRestrictPlpDataSettings(studyStartDate = "20100101", studyEndDate = "20101231",
firstExposureOnly = TRUE, washoutPeriod = 365, sampleSize = 1000)
#> $studyStartDate
#> [1] "20100101"
#>
#> $studyEndDate
#> [1] "20101231"
#>
#> $firstExposureOnly
#> [1] TRUE
#>
#> $washoutPeriod
#> [1] 365
#>
#> $sampleSize
#> [1] 1000
#>
#> attr(,"class")
#> [1] "restrictPlpDataSettings"