Closed lhjohn closed 3 years ago
A hack you can currently do is to create two covariate settings, one with any time prior covariates and end days = 0 and another with long term covariates and end days = -4, then combine these by creating a list of these settings: allCovs <- list(covAnyTime, covLongterm).
Does this also work with SkeletonPredictionStudy
, because when using the code below, the package wont get past creating the covariate tables?
Or should I better edit this directly in the hydrated package?
covariateSettings <- list(list(list(fnct = 'createCovariateSettings',
settings = list(FeatureExtraction::createCovariateSettings(useDemographicsGender = T,
longTermStartDays = -183,
endDays = -4,
useDrugGroupEraLongTerm = T),
FeatureExtraction::createCovariateSettings(useConditionGroupEraAnyTimePrior = T,
endDays = 0)))
)
Ok, now that I think about it, I can probably just do this?
covariateSettings <- list(list(list(fnct = 'createCovariateSettings',
settings = FeatureExtraction::createCovariateSettings(useDemographicsGender = T,
longTermStartDays = -183,
endDays = -4,
useDrugGroupEraLongTerm = T)),
list(fnct = 'createCovariateSettings',
settings = FeatureExtraction::createCovariateSettings(useConditionGroupEraAnyTimePrior = T,
endDays = 0)))
)
covariateSettings <- list(FeatureExtraction::createCovariateSettings(useDemographicsGender = T, longTermStartDays = -183, endDays = -4, useDrugGroupEraLongTerm = T),
FeatureExtraction::createCovariateSettings(useConditionGroupEraAnyTimePrior = T, endDays = 0) )
but if you want to edit the prediction json then try something like this should work: list( list(fnct = 'createCovariateSettings', settings = FeatureExtraction::createCovariateSettings(useDemographicsGender = T, longTermStartDays = -183, endDays = -4, useDrugGroupEraLongTerm = T) ),
list(fnct = 'createCovariateSettings', settings = FeatureExtraction::createCovariateSettings(useConditionGroupEraAnyTimePrior = T, endDays = 0) ) )
Thank you @jreps, those worked.
There is only a single parameter
endDays
, which is used as the end date for all covariates, even the one that are any time prior. Here is the code: LinkI would like to have
endDays = 0
for covariates that are assessed any time prior, butendDays = -4
for covariates that are assessed for a long term window.Is this possible (maybe with a small hack)?