Learn R Programming

PSsurvival (version 0.2.0)

summary.weightedKM: Summary Method for Weighted Kaplan-Meier Estimates

Description

Generates summary tables of weighted Kaplan-Meier survival or cumulative risk estimates with confidence intervals for each treatment group.

Usage

# S3 method for weightedKM
summary(
  object,
  type = "Kaplan-Meier",
  conf_type = "log-log",
  conf_level = 0.95,
  print.digits = 3,
  print.rows = 10,
  ...
)

Value

A list with one element per treatment group. Each element is a matrix with columns:

  • time: Evaluation time points

  • estimate: Survival probability or cumulative risk

  • se: Standard error

  • CI_lower: Lower confidence bound

  • CI_upper: Upper confidence bound

The list is returned invisibly with full precision. Printed output is rounded to print.digits decimal places and shows first print.rows

rows per group.

Arguments

object

An object of class "weightedKM" from weightedKM().

type

Type of estimate to summarize: "Kaplan-Meier" (survival probabilities, default) or "CR" (cumulative risk, aka. cumulative incidence = 1 - survival).

conf_type

Type of confidence interval: "plain", "log", or "log-log" (default). See ?plot.weightedKM for details.

conf_level

Confidence level for intervals. Default 0.95.

print.digits

Number of decimal places for printed output. Default 3.

print.rows

Number of rows to print for each treatment group. Default 10.

...

Additional arguments (currently unused).

Details

This method provides tabular summaries of weighted Kaplan-Meier estimates with confidence intervals. It uses the same CI calculation methods as plot.weightedKM().

When type = "CR", the function transforms survival estimates to cumulative risk \(1 - S\) and calculates confidence intervals on that scale.

The returned list contains full-precision matrices that can be used for further analysis. The printed output is rounded for readability.