OHDSI Home | Forums | Wiki | Github

CohortMethod user group

(Rohit Vashisht) #42

Hi Martijn,
I ran it using version 2.1.5 of FeatureExtraction.

(Martijn Schuemie) #43

@JUNGEUN_PARK: which versions of CohortMethod and FeatureExtraction are you running?

(Jungeun Park) #44

I was running vesion 2.1.3 of FeatureExtraction and just updating it solved my problem!
Thank you very much for your help. :slight_smile:

(Jungeun Park) #45

I wonder why I keep getting this error : 00904 Invalid with DibaetesTxPackage
Below is the error report.
Any advice would be appreciated. Thank you.


java.sql.SQLSyntaxErrorException: ORA-00904: : Invalid Identifier

CREATE TABLE gi05a2z4ohdsiT2DstudyPop (rowId FLOAT,subjectId FLOAT,treatment FLOAT,cohortStartDate DATE,daysFromObsStart FLOAT,daysToCohortEnd FLOAT,daysToObsEnd FLOAT,outcomeCount FLOAT,timeAtRisk FLOAT,daysToEvent FLOAT,survivalTime FLOAT)

R version:
R version 3.4.2 (2017-09-28)


Attached base packages:

  • stats
  • graphics
  • grDevices
  • utils
  • datasets
  • methods
  • base

Other attached packages:

  • gridExtra (2.3)
  • DiabetesTxPath (0.1.0)
  • EmpiricalCalibration (1.3.6)
  • CohortMethod (2.6.2)
  • FeatureExtraction (2.1.5)
  • DatabaseConnector (2.0.2)
  • SqlRender (1.4.6)
  • OhdsiSharing (0.1.3)
  • OhdsiRTools (1.5.3)
  • Cyclops (1.3.0)
  • rJava (0.9-9)

(Martijn Schuemie) #46

I’m pretty sure it’s because ROWID is a reserved word in Oracle. @rohitv: any idea where this SQL originated from?

(Martijn Schuemie) #47

Ah, wait, I see it. This call to insertTable would do the trick. @rohitv: you may want to change the column names of studyPop before you send it to the server.

I usually use

colnames(studyPop)  <- SqlRender::camelCaseToSnakeCase(colnames(studyPop))

to get snake_case field names, which is our standard for SQL.

(Rohit Vashisht) #48

Hi Martijn,



(Jungeun Park) #49

Thank you. I thought that the rowID might be causing the error, but had no idea how to fix that.
Still just waiting for any solutions.

Also, there was an error "'CohortMethodData' not found"
I wonder if this error is also related to Oracle.

(Seng Chan You) #50

@JUNGEUN_PARK Could you update the packages (especially, SqlRender like below) and try again?

(Jungeun Park) #51

Tried but didn’t really work. Thank you for the idea ,though :slight_smile:

(Martijn Schuemie) #52

Again, just guessing, but I think the problem with the cohortMethodData is caused here. The loadCohortMethodData function returns a cohortMethodData object, but here it is not assigned anywhere. The subsequent calls to cohortMethodData will throw errors. Probably that line should read:

cohortMethodData <- loadCohortMethodData(paste(results_path,"deleteMeBeforeSharing/CmData_l1_t1_c2",sep=""))

@rohitv: note that file.path is preferred over paste when creating a path.

(Jungeun Park) #53


I tried, but still didn’t work.
And still, cohortMethodData not Found error comes up.

I appreciate your suggestions. :slight_smile:

(Martijn Schuemie) #54

Hi @JUNGEUN_PARK. What exactly did you try? Do you have a new version of the study code I can inspect?

(Jungeun Park) #55

Hi @schuemie,
I tried the following line.

cohortMethodData <- loadCohortMethodData(paste(results_path,"deleteMeBeforeSharing/CmData_l1_t1_c2",sep=""))

I had to change more words to make this package work, and now (at leaste I think) I get all the outputs as expected.
But I still get 'CohortMethod' Data not found error. Maybe it is because of the data or the result of analysis?!

Thank you as always.

  • I have one more question. Everytime I run this, it gives me slightly different(or sometimes quite a lot) results. Is it because I set the maxcores=1? What is the reason of the different results?

(Martijn Schuemie) #56

If i search for ‘cohortMethodData’ in the same file I see many occurrences of loadCohortMethodData, without assigning the output to a variable. Did you fix all of them?

@rohitv: perhaps it would also be a good idea to fix the original study code?

I’m not very familiar with this code (I didn’t write it), but CohortMethod itself (which I did write) can give different answers on different runs because the sampling for the cross-validation for Cyclops (to establish the optimal hyper-parameter) is random and can differ between runs. In order to make things 100% deterministic, you can try setting the random seed in the Cyclops control object when calling createPs.

(Jungeun Park) #57


Yes, I fixed all of them and still had the same error above.
Thank you. :slight_smile: