I’m trying to add some extra characterizations for an estimation study we are doing. In particular, we wanted to add statistics of Age at Index to our results. With @Patrick_Ryan’s help, I found that covariateId 1002 was what I needed.
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
org.json.JSONException: JSONObject["isBinary"] not found.
However, when I call FeatureExtration::createCovariateSettings() and list out all the parameters I want, it works for me. Is there a way to call createDefaultCovariateSettings() and enable one of the demographics covariates?
Also, is there a way to add this to Table1? When I get the above working with createCovariateSettings(…), I make this call:
FeatureExtraction::createTable1(covariateData2)
However, I don’t see the Age statistics. I only see the AgeGroup stats, but when I call covariateData2$covariatesContinuous, I see the Age at Index stats. @schuemie do you have any recommendations?
Sorry about the cryptic error message. Here’s what’s happening: you specified a single covariate ID (1002), which corresponds to age as a continuous variable. However, the default set of covariates does not include this covariate (instead it includes age as 5-year bins). So you restrict the analysis to a covariate that will not be constructed.
To answer your first question: If you want to use all the default covariate settings except change the age from group to continuous variable, here’s how to do that:
So know you know the names of the two variables you care about: DemographicsAge and DemographicsAgeGroup. Now you can create a default set of covariates, and just change these variables:
Don’t restrict to covariate ID 1002, or you’ll only get the age covariate (although now it will not throw an error).
To answer your last question: to generate a table 1, you’ll need to modify the table 1 specifications. You can use the getDefaultTable1Specifications function to get to specifications for the default set of covariates. I’ll leave it to you to figure out how to modify those to use the continuous age variable instead Once you’re done, you can use these specifications as input to the createTable1 function
Me and Sigfried were also struggling with using the FeatureExtraction package. I am glad we are not the only ones.
Martijn, in your solution, you are still using the function createDefaultCovariateSettings and customizing it afterwards.
Is there a way to achieve that with createCustomCovariateSettings?
Our goal was to generate features about the cohort that temporality live after index event. E.g., how many HIV viral load tests the patient had 365 days after index. All the default covariates are for PS purposes and hence operate mostly prior index. We were hoping to use the FeatureExtraction package to describe a cohort (and not be restricted to time prior index time). We had to use custom SQL because it was hard to troubleshoot the FeatureExtraction error messages.