OHDSI Home | Forums | Wiki | Github

Custom covariate in PLE for PS matching

Hi everyone, how can I add custom covariates to my PS model in the population level estimation package?
For example, if I want a variable for presence of a hospitalization with a diagnosis of depression in any position during the pre-index period. I’ve done it before in PLP analyses by following this method, but don’t see how that works in the framework of the PLE package. I don’t see where to modify the createCovariateSettings, createCohortAttrCovariateSettings, and getDbCovariateData functions.
Any help would be appreciated!
Dave

Not trivial to add to a study package generated in ATLAS, but straightforward if you wrote your study yourself using the CohortMethod package.

If you already have experience creating custom covariate builders (like you cited), then the trick is to combine the default and custom covariate builders in a list before feeding it to CohortMethod. See an example here.

Thanks Martijn. Looks like going back to creating the study myself using the cohort method package might be the way to go. Too bad, it is super convenient having the package created for me!

I noticed one thing. The variables for “Condition - Primary inpatient” have the exact same names as their “Condition” counterparts. That is, there’s nothing in the name that specifies that they are inpatient variables. See example below from the covariate balance output. @jennareps pointed out to me that the analysisIDs 105 through 108 are the inpatient IDs, but without knowing that I wouldn’t have figured it out.

beforeMatchingMeanTarget beforeMatchingMeanComparator beforeMatchingSumTarget beforeMatchingSumComparator beforeMatchingSd afterMatchingMeanTarget afterMatchingMeanComparator afterMatchingSumTarget afterMatchingSumComparator afterMatchingSd covariateName analysisId conceptId beforeMatchingStdDiff afterMatchingStdDiff
0.099894403 0.03902834 473 964 0.252409033 0.087571266 0.096465222 384 423 0.289017493 condition_occurrence any time prior through 0 days relative to index: Depressive disorder 105 440383 0.24114059 -0.030773074
0.557127772 0.54242915 2638 13398 0.497461649 0.54618016 0.542075257 2395 2377 0.49804471 condition_occurrence any time prior through 0 days relative to index: Depressive disorder 101 440383 0.029547247 0.008242037

Thanks! I just created a commit to give those features different names. So will be included in the next release of FeatureExtraction.

t