Runs a suite of diagnostic tests to assess the validity of SCC analysis assumptions. Version 1.6.0+ implements diagnostics aligned with SelfControlledCaseSeries package standards.
runSccDiagnostics(
connection,
cdmDatabaseSchema,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
resultsTable,
riskWindowsTable,
outcomeTable = "condition_era",
outcomeDatabaseSchema = cdmDatabaseSchema,
analysisId,
databaseId,
estimates = NULL,
controlType = "outcome",
diagnostics = c("all"),
thresholds = getDefaultDiagnosticThresholds(),
computeThreads = getOption("strategus.SelfControlledCohort.computeThreads", default =
parallel::detectCores() - 1),
resultExportManager
)DatabaseConnector connection instance
Name of database schema that contains OMOP CDM
Schema for temp table emulation (Oracle, Impala)
Name of the results table (contains counts)
Name of the risk windows table
Name of outcome table (e.g., "condition_era", "cohort")
Schema containing outcome table
Analysis identifier
Database identifier for results export
Data frame of raw SCC results (including rr and se_log_rr)
Calibrate effect estimates with outcome (default) or exposure controls. Determines whether EASE is grouped by target or outcome.
Character vector of diagnostics to run. Options: "all", "mdrr", "pre_exposure_gain", "event_dependent", "ease"
Named list of diagnostic thresholds (see getDefaultDiagnosticThresholds)
Number of parallel threads to use for CPU-bound diagnostic computations (e.g., MDRR and EASE). Default is the number of available cores minus 1.
ResultModelManager::ResultExportManager instance
Invisible data frame of diagnostic results
# \donttest{
if (interactive()) {
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
connection <- DatabaseConnector::connect(connectionDetails)
diagnostics <- runSccDiagnostics(
connection = connection,
cdmDatabaseSchema = "main",
resultsTable = "#scc_results",
riskWindowsTable = "#risk_windows",
analysisId = 1,
databaseId = "Eunomia",
estimates = resultsData,
diagnostics = "all",
thresholds = getDefaultDiagnosticThresholds()
)
DatabaseConnector::disconnect(connection)
}
# }