The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
OdysseusSurvivalModule supports a two-step workflow:
singleEventSurvival().This vignette uses Eunomia as the example CDM and focuses on the package API as it exists today.
The exported function is singleEventSurvival(). The
cohort-to-survival-data helper, addCohortSurvival(), is
currently internal, so vignette examples call it with
:::.
addCohortSurvival() does not create cohorts from concept
IDs. It expects existing target and outcome cohort tables. In a typical
OHDSI workflow, those cohorts are created ahead of time with ATLAS,
Circe, or custom SQL and stored in the cohort results schema.
For the examples below, assume a table named cohort
exists in the Eunomia results schema and contains:
12survivalData <- OdysseusSurvivalModule:::addCohortSurvival(
connection = connection,
cdmDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema = cohortDatabaseSchema,
targetCohortTable = "cohort",
targetCohortId = 1,
outcomeCohortTable = "cohort",
outcomeCohortId = 2,
outcomeDateVariable = "cohort_start_date",
followUpDays = 365,
includeAge = TRUE,
includeGender = TRUE
)
head(survivalData)The resulting data frame contains subject_id,
time, and status, with optional
age_years and gender columns when
requested.
kmFit <- singleEventSurvival(
survivalData = survivalData,
timeScale = "days",
model = "km",
strata = "gender",
confInt = 0.95
)
names(kmFit)
kmFit[["overall"]]$summary
kmFit[["gender=Female"]]$summary
kmFit$logrank_test_genderThe returned object is a named list. Each stratum entry contains:
data: survival step datasummary: aggregate statistics such as median and mean
survivalWhen strata = "gender", the list includes entries such
as gender=Female and gender=Male, plus
overall.
overall_curve <- kmFit[["overall"]]$data
female_curve <- kmFit[["gender=Female"]]$data
head(overall_curve)
head(female_curve)Each data table contains stepwise survival information,
including time, n_risk, n_event,
survival, hazard, and cumulative event
counts.
singleEventSurvival() returns tabular survival output
rather than a survfit object, so plotting is done from the
returned data frame.
The model argument supports "km",
"cox", "weibull", "exponential",
"lognormal", and "loglogistic".
coxFit <- singleEventSurvival(
survivalData = survivalData,
timeScale = "days",
model = "cox",
covariates = c("age_years"),
confInt = 0.95
)
weibullFit <- singleEventSurvival(
survivalData = survivalData,
timeScale = "days",
model = "weibull",
covariates = c("age_years")
)
coxFit[["overall"]]$summary
weibullFit[["overall"]]$summaryFor Cox and parametric models, the function still returns survival summaries and step data. It does not return a coefficient table or hazard-ratio table.
The core workflow is:
OdysseusSurvivalModule:::addCohortSurvival().singleEventSurvival().data and summary
components directly.These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.