KaplanMeier: Kaplan Meier Product Limit Estimator

Description Usage Arguments Value Examples

View source: R/survivalfunctions.R

Description

Survival function estimate using Kaplan Meier method

Usage

1
KaplanMeier(x, rs)

Arguments

x

The value to pass to the Kaplan Meier function

rs

is the output from RiskSet(...)

Value

The estimate of the survival function at a given value of x

Examples

1
2
3
4
5
6
x <- c(1.0,1.3,1.5,1.5,2.1,2.1,2.1,2.8)
rs <- RiskSet(x)
plot.stepfun(ecdf(x), verticals=TRUE, pch='',
             ylab="F(x)", main="Empirical CDF")
plot(function(y) NelsonAalen(y,rs), 0, 3,
     type='s', ylab="H(x)", main="Nelson-Aalen estimate of H(x)")

nathanesau/lmodels documentation built on May 23, 2019, 12:19 p.m.