OHDSI Home | Forums | Wiki | Github

FeatureExtraction, having trouble with createTable1


(Sigfried Gold) #1

I’ve been trying all sorts of different covariate settings and getDbCovariateData parameters and I can’t remember what all else, but when I get to the point of trying to run createTable1 (or, sometimes before that in getDbCovariateData) I hit a wall.

The steps required with this nascent package to get to the points I’m talking about are:

  1. clone the repo

  2. run PackageMaintenance.R
    A. this and the next step require a .env (dotenv) file with connection settings which should look sort of like this:
    PGHOST=localhost
    PGPORT=5432
    PGUSER="…"
    PGDATABASE="…"
    PGPASSWORD="…"
    CDM_SCHEMA="…"
    RESULTS_SCHEMA="…_results"
    VOCAB_SCHEMA="…_vocab"
    WebAPIBaseUrl=“http://api.ohdsi.org:80/WebAPI
    OUTPUT_FOLDER="/tmp/study_results"

  3. run the code in CodeToRun.R

At the moment I’m getting this error:

Error: Error executing SQL:
cannot change working directory
An error report has been created at  
/export/home/goldss/projects/HivDescriptive/errorReport.txt

while running the getDbCovariateData function. Depending on the order of running commands, this sometimes goes away.

Thanks


(Vojtech Huser) #2

This is hugely important for us. tagging @schuemie
We did study all the vignettes. e.g., here http://ohdsi.github.io/FeatureExtraction/articles/UsingFeatureExtraction.html#creating-aggregated-covariates-for-a-cohort-of-interest

Q:
Is there a previous OHDSI study using Table 1 that we could learn from.

Q:
We also hope to learn how to customize the age covariate (to customize the bins e.g., 18-34,35-45,46-50,50-55).


(Sigfried Gold) #3

I’ve gotten past the complete bottleneck, but am still confused.

For future readers (including myself), there’s good background material on FeatureExtraction and Table 1 here and here.

The thing that got me unstuck was adding a rowIdField = "subject_id" parameter to getDbCovariateData, as per section 3.3 of the FeatureExtraction vignette. But part of why I’m confused is that it continues working when I remove that parameter again. Also, my table 1 now includes more covariates, but not all that I’ve asked for. So I suspect something has to run on the database side to prepare the covariates and isn’t getting run in the code I have; but I’m not yet understanding the process well enough to know what that is.


(Sigfried Gold) #4

I just noticed: the FeatureExtraction vignette @Vojtech_Huser referenced above is newer than the one I referenced. The parameter that seemed to help me, rowIdField is deleted in the getDbCovariateData call in the newer one. But there’s a note:

Note that we specified aggregated = TRUE . Also, we are no longer required to define a rowIdField because we will no longer receive per-person data.

I noticed that I wasn’t explicitly running my cohort creation queries as I worked on the Table 1 issue. But as long as I have at least one cohort created (which I did), I ought to get as many Table 1 variables as I ask for, right?


t