Create a study population
createStudyPopulation( plpData, population = NULL, outcomeId, binary = T, includeAllOutcomes = T, firstExposureOnly = FALSE, washoutPeriod = 0, removeSubjectsWithPriorOutcome = TRUE, priorOutcomeLookback = 99999, requireTimeAtRisk = F, minTimeAtRisk = 365, riskWindowStart = 0, startAnchor = "cohort start", riskWindowEnd = 365, endAnchor = "cohort start", verbosity = "INFO", restrictTarToCohortEnd = F, addExposureDaysToStart, addExposureDaysToEnd, ... )
An object of type
If specified, this population will be used as the starting point instead of the
cohorts in the
The ID of the outcome.
Forces the outcomeCount to be 0 or 1 (use for binary prediction problems)
(binary) indicating whether to include people with outcomes who are not observed for the whole at risk period
Should only the first exposure per subject be included? Note that
this is typically done in the
The mininum required continuous observation time prior to index date for a person to be included in the cohort.
Remove subjects that have the outcome prior to the risk window start?
How many days should we look back when identifying prior outcomes?
Should subject without time at risk be removed?
The minimum number of days at risk required to be included
The start of the risk window (in days) relative to the
The anchor point for the start of the risk window. Can be "cohort start" or "cohort end".
The end of the risk window (in days) relative to the
The anchor point for the end of the risk window. Can be "cohort start" or "cohort end".
Sets the level of the verbosity. If the log level is at or higher in priority than the logger threshold, a message will print. The levels are:
If using a survival model and you want the time-at-risk to end at the cohort end date set this to T
DEPRECATED: Add the length of exposure the start of the risk window? Use
DEPRECATED: Add the length of exposure the risk window? Use
A data frame specifying the study population. This data frame will have the following columns:
A unique identifier for an exposure
The person ID of the subject
The index date
The number of outcomes observed during the risk window
The number of days in the risk window
The number of days until either the outcome or the end of the risk window
Create a study population by enforcing certain inclusion and exclusion criteria, defining a risk window, and determining which outcomes fall inside the risk window.