OHDSI Home | Forums | Wiki | Github

Using multiple concept ids for includeCovariateIds in SelfControlledCaseSeries package

Dear all,

I’m researching about cardiovascular safety of Methylphenidate drugs using SelfControlledCaseSeries package.

Below is the code I used.

sql <- readSql(“vignette_Methylphenidate_Cardiovascular.sql”)
sql <- renderSql(sql,
cdmDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema = cohortDatabaseSchema,
outcomeTable = outcomeTable)$sql
sql <- translateSql(sql, targetDialect = connectionDetails$dbms)$sql
connection <- connect(connectionDetails)
executeSql(connection, sql)

methylphenidate <- c(21604757, 40236413, 40236419, 40236426, 40236439,
40236442, 40236459, 40236463, 40236481) #methylphenidate concept id
sccsData <- getDbSccsData(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
oracleTempSchema = cdmDatabaseSchema,
outcomeDatabaseSchema = cohortDatabaseSchema,
outcomeTable = outcomeTable,
outcomeIds = 5, #cohort definition id
exposureDatabaseSchema = cdmDatabaseSchema,
exposureTable = “drug_era”,
exposureIds = methylphenidate,
cdmVersion = cdmVersion)

covarateSplit = createCovariateSettings(label = “Exposure of methylphenidate”,
includeCovariateIds = methylphenidate,
start = 0,
end = 730,
addExposedDaysToEnd = TRUE,
splitPoints = c(7,14,28,56)
)
covariatePreSplit = createCovariateSettings(label = “Pre-exposure”,
includeCovariateIds = methylphenidate,
start = -60,
end = -1,
splitPoints = c(-30)
)

sccsEraData <- createSccsEraData(sccsData,
naivePeriod = 30,
firstOutcomeOnly = FALSE,
covariateSettings = list(covarateSplit,
covariatePreSplit)
)
model <- fitSccsModel(sccsEraData)
summary(model)

I got an error when I use the createSccsEraData function.

Error in x[…] <- m : NAs are not allowed in subscripted assignments

I’ve used SelfControlledCaseSeries package for other research.
And then I used only one concept id for exposure and includeCovariateIds.

How can I use multiple concept ids for exposure?

Thank you.

Hi @Hojun_Park,

I’m sorry, the error message is indeed very cryptic. The problem seems to be the following: your list of exposure IDs (21604757, 40236413, 40236419, 40236426, 40236439,40236442, 40236459, 40236463, 40236481) contains one ATC concept and the rest are clinical drugs. You specify exposureTable = "drug_era", and the drug_era table should only contain concepts at the ingredient level.

In other words: no exposures were found in the table. I’ll try to make the error message more meaningful, but you’ll have to resolve your actual problem. Only use the concept ID for the ingredient as exposureId if you want to generate results for the ingredient, or create custom exposure cohorts if you want something else, like analyses per clinical drug, strength or brand.

Thank you for your help @schuemie.
Following your comments, I used only ingredient level concepts.
So, I’ve solved the problem and got results.

t