Hello OHDSI community,
I recently adapted an observational study pipeline using the latest version of CohortMethod, and specifically the runCmAnalyses function. The code took 18.7 days to execute and returned the expected tibble, but the tibble references file paths that don’t exist. The whole command ran without errors - except that noting that the “schema” parameter is depreciating. However, I used the syntax in the tutorial for Running Multiple Analyses.
I’d like to figure out why the code is executing so slowly - is that a reasonable time to wait?
And second, I’m not sure why the function didn’t write any results to disk. I’m running two analysis, one without matching and one with matching. The method seems to have generated “Analysis_1” and “Analysis_2” sub folders in my outputFolder and the outcomeModelReference.rds file in the outputFolder.
The only slight change in my analysis is that instead of using the drug_era table to define cohorts, I used a table that I defined because I needed to further specify drug exposure ordering when defining cohorts. Could this affect how the method tries to do propensity matching?
I included code of how I called the method below. And I’d be happy to share more code if that could help figure out if I am mis-using the method. Thanks for any insights you might have!
getDbCmDataArgs <- createGetDbCohortMethodDataArgs(washoutPeriod = 0,
restrictToCommonPeriod = FALSE,
firstExposureOnly = TRUE,
removeDuplicateSubjects = “remove all”,
studyStartDate = “20090101”,
studyEndDate = “20191231”,
excludeDrugsFromCovariates = FALSE,
covariateSettings = covarSettings)
createStudyPopArgs <- createCreateStudyPopulationArgs(removeSubjectsWithPriorOutcome = TRUE,
minDaysAtRisk = 1,
riskWindowStart = 0,
startAnchor = “cohort start”,
endAnchor = “cohort end”)
fitOutcomeModelArgs1 <- createFitOutcomeModelArgs(modelType = “cox”)
cmAnalysis1 <- createCmAnalysis(analysisId = 1,
description = “No matching, simple outcome model”,
getDbCohortMethodDataArgs = getDbCmDataArgs,
createStudyPopArgs = createStudyPopArgs,
fitOutcomeModel = TRUE, fitOutcomeModelArgs = fitOutcomeModelArgs1)
createPsArgs <- createCreatePsArgs() # Use default settings only
matchOnPsArgs <- createMatchOnPsArgs(maxRatio = 100)
fitOutcomeModelArgs2 <- createFitOutcomeModelArgs(modelType = “cox”,stratified = TRUE)
cmAnalysis2 <- createCmAnalysis(analysisId = 2, description = “Matching”,
getDbCohortMethodDataArgs = getDbCmDataArgs,
createStudyPopArgs = createStudyPopArgs, createPs = TRUE,
createPsArgs = createPsArgs, matchOnPs = TRUE,
matchOnPsArgs = matchOnPsArgs, fitOutcomeModel = TRUE,
fitOutcomeModelArgs = fitOutcomeModelArgs1)
cmAnalysisList <- list(cmAnalysis1, cmAnalysis2)
result <- runCmAnalyses(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, exposureDatabaseSchema = resultsDatabaseSchema, exposureTable = target_cohort_table, outcomeDatabaseSchema = cdmDatabaseSchema, outcomeTable = “condition_era”, cdmVersion = cdmVersion, outputFolder = outputFolder, cmAnalysisList = cmAnalysisList, targetComparatorOutcomesList = targetComparatorOutcomesList, getDbCohortMethodDataThreads = 1, createPsThreads = 1, psCvThreads = 10, createStudyPopThreads = 4, trimMatchStratifyThreads = 10,
fitOutcomeModelThreads = 4, outcomeCvThreads = 10)