test_nonpar: Non-inferiority and equivalence test for the difference of...

Description Usage Arguments Value Examples

View source: R/test_nonpar.R

Description

Function for fitting and testing two Kaplan Meier curves S_1, S_2 at t_0 concerning the hypotheses of non-inferiority

H_0:S_1(t_0)-S_2(t_0)≥q ε\ vs.\ H_1: S_1(t_0)-S_2(t_0)< ε

or equivalence

H_0:|S_1(t_0)-S_2(t_0)|≥q ε\ vs.\ H_1: |S_1(t_0)-S_2(t_0)|< ε.

Usage

1
test_nonpar(epsilon, alpha, t0, type, data_r, data_t, plot = TRUE)

Arguments

epsilon

non-inferiority/equivalence margin

alpha

significance level

t0

time point of interest

type

type of the test. "ni" for non-inferiority, "eq" for equivalence test

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), the lower and upper (1-α)-confidence bounds, the chosen margin and significance level and the test decision. Further a plot of the curves is given.

Examples

1
2
3
4
5
6
7
data(veteran)
veteran_r <- veteran[veteran$trt==1,]
veteran_t <- veteran[veteran$trt==2,]
alpha<-0.05
t0<-80
epsilon<-0.15
test_nonpar(epsilon=epsilon,alpha=alpha,t0=t0,type="eq",data_r=veteran_r,data_t=veteran_t)

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