kmest: Kaplan-Meier estimates of the survival curve

View source: R/RcppExports.R

kmestR Documentation

Kaplan-Meier estimates of the survival curve

Description

Obtains the Kaplan-Meier estimates of the survival curve.

Usage

kmest(
  data,
  rep = "rep",
  stratum = "stratum",
  time = "time",
  event = "event",
  conftype = "log-log",
  confint = 0.95
)

Arguments

data

The input data frame that contains the following variables:

  • rep: The replication for by-group processing.

  • stratum: The stratum.

  • time: The possibly right-censored survival time.

  • event: The event indicator.

rep

The name of the replication variable in the input data.

stratum

The name of the stratum variable in the input data.

time

The name of the time variable in the input data.

event

The name of the event variable in the input data.

conftype

The type of confidence interval. One of "none", "plain", "log", "log-log" (the default), or "arcsin". The arcsin option bases the intervals on asin(sqrt(survival)).

confint

The level of the two-sided confidence interval for the survival probabilities. Defaults to 0.95.

Value

A data frame with the following variables:

  • rep: The replication.

  • stratum: The stratum.

  • size: The number of subjects in the stratum.

  • time: The event time.

  • nrisk: The number of subjects at risk.

  • nevent: The number of subjects having the event.

  • survival: The Kaplan-Meier estimate of the survival probability.

  • stderr: The standard error of the estimated survival probability based on the Greendwood formula.

  • lower: The lower bound of confidence interval if requested.

  • upper: The upper bound of confidence interval if requested.

  • confint: The level of confidence interval if requested.

  • conftype: The type of confidence interval if requested.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


kmest(data = aml, stratum = "x",
      time = "time", event = "status")


lrstat documentation built on June 23, 2024, 5:06 p.m.