confint_km_diff: Lower and upper confidence bounds for the difference of two...

Description Usage Arguments Value Examples

View source: R/confint_km_diff.R

Description

Function fitting Kaplan-Meier curves S_1, S_2 to two groups and yielding lower and upper (1-α)-confidence bounds for the difference S_1-S_2 of these two curves at a specific time point by using Greenwood's formula.

Usage

1
confint_km_diff(alpha, t0, data_r, data_t, plot = TRUE)

Arguments

alpha

confidence level

t0

time point of interest

data_r, data_t

datasets containing time and status for each individual

plot

if TRUE, a plot of the two Kaplan Meier curves will be given

Value

A list containing the difference S_1(t_0)-S_2(t_0) and the lower and upper (1-α)-confidence bounds. Further a plot of the curves is given.

Examples

1
2
3
4
5
6
data(veteran)
veteran_r <- veteran[veteran$trt==1,]
veteran_t <- veteran[veteran$trt==2,]
alpha<-0.05
t0<-80
confint_km_diff(alpha=alpha,t0=t0,data_r=veteran_r,data_t=veteran_t)

EquiSurv documentation built on Oct. 23, 2020, 6:43 p.m.