R/GetCovariatesFromCohortAttributes.R
createCohortAttrCovariateSettings.Rd
Create cohort attribute covariate settings
createCohortAttrCovariateSettings(
analysisId = -1,
attrDatabaseSchema,
attrDefinitionTable = "attribute_definition",
cohortAttrTable = "cohort_attribute",
includeAttrIds = c(),
isBinary = FALSE,
missingMeansZero = FALSE
)
A unique identifier for this analysis.
The database schema where the attribute definition and cohort attribute table can be found.
The name of the attribute definition table.
The name of the cohort attribute table.
(optional) A list of attribute definition IDs to restrict to.
Needed for aggregation: Are these binary variables? Binary variables should only have the values 0 or 1.
Needed for aggregation: For continuous values, should missing values be interpreted as 0?
An object of type covariateSettings
, to be used in other functions.
Creates an object specifying where the cohort attributes can be found to construct covariates. The attributes should be defined in a table with the same structure as the attribute_definition table in the Common Data Model. It should at least have these columns:
A unique identifier of type integer.
A short description of the attribute.
The cohort attributes themselves should be stored in a table with the same format as the cohort_attribute table in the Common Data Model. It should at least have these columns:
A key to link to the cohort table.
A key to link to the cohort table.
A key to link to the cohort table.
An foreign key linking to the attribute definition table.
A real number.
# \donttest{
covariateSettings <- createCohortAttrCovariateSettings(
analysisId = 1,
attrDatabaseSchema = "main",
attrDefinitionTable = "attribute_definition",
cohortAttrTable = "cohort_attribute",
includeAttrIds = c(1),
isBinary = FALSE,
missingMeansZero = FALSE
)
# }