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.