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,
  diagnostics = c("all"),
  thresholds = getDefaultDiagnosticThresholds(),
  resultExportManager
)

Arguments

connection

DatabaseConnector connection instance

cdmDatabaseSchema

Name of database schema that contains OMOP CDM

tempEmulationSchema

Schema for temp table emulation (Oracle, Impala)

resultsTable

Name of the results table (contains counts)

riskWindowsTable

Name of the risk windows table

outcomeTable

Name of outcome table (e.g., "condition_era", "cohort")

outcomeDatabaseSchema

Schema containing outcome table

analysisId

Analysis identifier

databaseId

Database identifier for results export

estimates

Data frame of raw SCC results (including rr and se_log_rr)

diagnostics

Character vector of diagnostics to run. Options: "all", "mdrr", "pre_exposure_gain", "event_dependent", "ease"

thresholds

Named list of diagnostic thresholds (see getDefaultDiagnosticThresholds)

resultExportManager

ResultModelManager::ResultExportManager instance

Value

Invisible data frame of diagnostic results

Examples

if (FALSE) { # \dontrun{
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)
} # }