km.est: Kaplan-Meier Estimates

Description Usage Arguments Value Examples

View source: R/km.est.R

Description

Estimate survival probabilities by standard KM method

Usage

1
km.est(y,delta,treat,treat.select,t)

Arguments

y

a numeric vector of observed time

delta

a factor vector of indicator for events

treat

a factor vector of indicator for treatment

treat.select

a numeric value of treatment selected for estimation, 1 for treatment group, 0 for control group

t

a numeric vector of time points for estimation

Value

A list containing the following components:

St

point estimates of survival probability (S(t)) at t

sd

standard deviation of survival probability (S(t)) at t

Examples

1
2
3
4
5
6
7
library(survival)
y <- as.matrix(gbsg$rfstime/(365.25/12))
treat <- data.matrix(gbsg$hormon)
delta <- as.matrix(gbsg$status)
t <- seq(0,80,2)

km.est(y=y,delta=delta,treat=treat,treat.select=1,t=t)

kimihua1995/adjKMtest documentation built on Jan. 1, 2021, 7:20 a.m.