Skip to contents

Performs Kaplan-Meier survival analysis for a single group of subjects. This function estimates survival probabilities over time and provides summary statistics including median survival time with confidence intervals. It generates both tabular results and Kaplan-Meier survival plots.

Details

The function performs the following analyses:

  • Kaplan-Meier survival estimation using survival package

  • Calculation of median survival time with 95% confidence intervals

  • Summary statistics (number of subjects, number of events)

  • Kaplan-Meier survival curve visualization

  • Optional confidence interval bands on plots

The function requires two variables:

  • Time variable: Time to event or censoring (continuous, positive values)

  • Status variable: Event indicator (0 = censored, 1 = event occurred)

Data Requirements

For valid survival analysis, ensure:

  • Time values are non-negative and numeric

  • Status values are binary (0/1 or equivalent)

  • At least some events have occurred (not all censored)

  • Sufficient sample size for reliable estimates

References

Kaplan, E. L., & Meier, P. (1958). Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, 53(282), 457-481.

See also

Author

ClinicoPath Development Team

Super classes

jmvcore::Analysis -> ClinicoPath::oneSurvivalBase -> oneSurvivalClass

Examples

if (FALSE) { # \dontrun{
# Basic survival analysis
result <- oneSurvival(
  data = lung_data,
  times = "survival_time",
  status = "death_indicator"
)

# With confidence intervals and time units
result <- oneSurvival(
  data = clinical_data,
  times = "days_to_event",
  status = "event_occurred",
  ciyn = TRUE,
  timeunits = "Days"
)
} # }