OHDSI Home | Forums | Wiki | Github

Repeated row-column entry Error in .loadCyclopsDataMultipleX using createPs()

Hello OHDSI community,

I’m a relatively new user who is trying to compare the rate of myocardial infarction in patients using one group of drugs as compared to another. I’ve been following the cohortMethod tutorial but am running into the following error when I try to create the propensity score:
> ps <- createPs(cohortMethodData = cohortMethodData, population = studyPop, excludeCovariateIds = c(grp1Drugs,grp2Drugs))
Removing redundant covariates
Removing redundant covariates took 3.53 secs
Removing infrequent covariates
Removing infrequent covariates took 6.55 secs
Normalizing covariates
Normalizing covariates took 6.21 secs
Error in .loadCyclopsDataMultipleX(object, covariateId, rowId, covariateValue, : _
_ Repeated row-column entry at 6 - 1007

I have checked my cohortMethodData$cohorts and there are no duplicate entries and have checked the subsequent studyPop and also not found duplicate subjects. I think the duplicates are in the covariate table, but I’m not familiar with the Cyclops package or ff to understand how to debug this issue. Does anyone have any suggestions for finding the cause of this error? I’ve included some more of my code below in case it’s helpful, but let me know if further information could help figure out the issue. Thank you,

cohortMethodData <- getDbCohortMethodData(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdm_database_schema, oracleTempSchema = target_database_schema,
targetId = 5,comparatorId = 6,outcomeIds = 1,
studyStartDate = “20090101”,studyEndDate = “20191231”,
exposureDatabaseSchema = target_database_schema, exposureTable = target_cohort_table,
outcomeDatabaseSchema = target_database_schema, outcomeTable = target_cohort_table,
cdmVersion = cdmVersion, excludeDrugsFromCovariates = TRUE, firstExposureOnly = FALSE,
removeDuplicateSubjects = TRUE, restrictToCommonPeriod = FALSE,
washoutPeriod = 0, covariateSettings = list(grp1covSettings,grp2covSettings))

studyPop <- createStudyPopulation(cohortMethodData = cohortMethodData, outcomeId = 1,
firstExposureOnly = FALSE, restrictToCommonPeriod = FALSE, washoutPeriod = 0,
removeDuplicateSubjects = “remove all”, removeSubjectsWithPriorOutcome = TRUE, minDaysAtRisk = 1,
riskWindowStart = 0, startAnchor = “cohort start”, riskWindowEnd = 30,
endAnchor = “cohort end”)

Sorry for not responding sooner. My guess is there’s a collision in covariate IDs. You seem to be using two covariate builders:

covariateSettings = list(grp1covSettings,grp2covSettings)

You only need one to construct the covariates for both cohorts.

Thanks, this is helpful! I had wanted to exclude two sets of drugs, but it looks like I only needed to create one covariate setting (createDefaultCovariateSettings) to achieve that instead of combining two separate covariate settings.

t