fixtdiff: Two sample test for Difference in Survival at Fixed Time

Description Usage Arguments Details Value Warning Author(s) References Examples

View source: R/bpcp2sample.R

Description

Asymptotic two sample tests for difference in survival at a fixed time, using normal approximations and transformations. See Klien, et al (2007) for details.

Usage

1
2
3
fixtdiff(time,status,group, testtime, 
    trans=c("identity","cloglog","log"),
    varpooled=TRUE, correct=FALSE, doall=FALSE)

Arguments

time

time to event for each observation

status

status of event time, 1 is observed, 0 is right censored

group

group for test, should have two levels, to change order use as factor and change order of levels

testtime

fixed time when you want to test for a difference

trans

type of transformation, one of 'identity', 'cloglog' or 'log'

varpooled

logical, pool the variance?

correct

logical, do continuity correction? Continuity correction for when trans='identity' and varpooled (see Warning)

doall

logical, do all transformations and corrections

Details

This function provides p-values for the two sample tests that the survival distributions are equal at time testtime. The tests are asymptotically normal tests and are described in Klein, et al (2007). These functions are mostly for simulations to evaluate the melded BPCP tests, see bpcp2samp and Fay et al (2015).

Value

A list with the following components:

plo

one-sided p-value, alternative: S1(testtime)>S2(testtime)

phi

one-sided p-value, alternative: S1(testtime)<S2(testtime

p2

two-sided p-value, min(1,2*plo,2*phi)

Warning

Continuity correction derived from the case with no censoriing (see Fleiss et al 3rd edition, pp. 50-55). May not make sense when there is censoring. Use at own risk.

Author(s)

Michael P. Fay

References

Fay, MP, Proschan, MA, and Brittain, E (2015) Combining One Sample Confidence Procedures for Inferences in the Two Sample Case. Biometrics 71:146-156.

Fleiss, Levin, Paik (2003) Statistical Methods for Rates and Proportions, 3rd edition.

Klein, Logan, Harhoff, and Andersen (2007). Analyzing survival curves at a fixed point in time. Statistics in Medicine 26(24): 4505-4519.

Examples

1
2
3
4
5
data(leuk2)
# Note that since the Kaplan-Meier survival at time=35 goes to 
# zero for one group, the results for the log and cloglog 
# transformations are undefined
fixtdiff(leuk2$time,leuk2$status,leuk2$treatment,35,doall=TRUE)

bpcp documentation built on Dec. 7, 2019, 9:06 a.m.