survdiffr: Test median survival differences (or other quantile)

Description Usage Arguments Details Value References See Also Examples

Description

Obtain bootstrap replicates of the median survival time for different groups of subjects. We can compute confidence intervals using boot package.

Usage

1
survdiffr(formula, data, q, B = 500, boot.F = "WC", boot.G = "none", ...)

Arguments

formula

A formula object. If a formula object is supplied it must have a Survr object as the response on the left of the ~ operator and a term on the right. For a single bootstrap median survival the "~1" part of the formula is required.

data

A data frame in wich to interpret the variables named in the formula.

q

Quantile that we are interested in to obtain a bootstrap sample from survival function

B

Number of boostrap samples

boot.F

a character string specifying the boostrap procedure. Possible value are either "PSH" or "WC" for nonparametric boostrap or "semiparametric" for semiparametric boostrap. The default is "WC". Only the first words are required, e.g "P","W","se"

boot.G

a character string specifying if we also resample form censored empirical distribution. Possible value are either "none" or "empirical". The default is "none". Only the first words are required, e.g "n","e"

...

additional arguments passed to the type of estimator.

Details

See reference. Some procedures can be slow

Value

A boot object. Bootstrap confidence intervals can be computed using boot.ci function from boot package

References

Gonzalez JR, Pe<f1>a EA. Bootstraping median survival with recurrent event data. IX Conferencia Espa<f1>ola de Biometr<ed>a; 2003 May 28-30; A Coru<f1>a, Espa<f1>a.

Paper available upon request to the mantainer

See Also

survfitr,boot.ci

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
data(colon)

#We will compare the median survival time for three dukes stages
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5)
boot.ci(fit$"1", type=c("norm","basic", "perc"))
boot.ci(fit$"2", type=c("norm","basic", "perc"))
boot.ci(fit$"3", type=c("norm","basic", "perc"))

# 75th quantile of survival function
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.75)
# bootstrap percentile confidence interval
quantile(fit$"1"$t,c(0.025,0.975))
quantile(fit$"2"$t,c(0.025,0.975))
quantile(fit$"3"$t,c(0.025,0.975))

# We could execute this if there is none Inf value
# boot.ci(fit$"1")
# boot.ci(fit$"2")
# boot.ci(fit$"3")


# We can modify the bootstrap procedure modifiying boot.F parameter
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5,boot.F="PSH")
# bootstrap percentile confidence interval
quantile(fit$"1"$t,c(0.025,0.975))
quantile(fit$"2"$t,c(0.025,0.975))
quantile(fit$"3"$t,c(0.025,0.975))

survrec documentation built on May 30, 2017, 7:19 a.m.

Related to survdiffr in survrec...