Learn R Programming

RVAideMemoire (version 0.9-6)

surv.multcomp: Pairwise comparisons for survival analysis.

Description

Perform pairwise comparisons between groups for equality of time to event. The function deals with coxph and survreg models.

Usage

surv.multcomp(surv, fact, mat, strata = NULL, type = c("survreg", "coxph"), distribution = "exponential", p.method = "fdr")

Arguments

surv
survival object. See help of the Surv() function.
fact
factor (groups).
mat
matrix of comparisons (see help of the esticon() function in doBy package).
strata
strata, if needed.
type
model type: "survreg" or "coxph".
distribution
distribution when a survreg model is used.
p.method
method for p-values correction. See help of the p.adjust() function.

Value

  • modelmodel formula.
  • statisticstest statistics.
  • p.methodmethod for p-values correction.
  • p.valuecorrected p-values.
  • comparisonsdata.frame of results.

See Also

survreg, coxph

Examples

Run this code
death<-c(sample(8:15,20,replace=TRUE),sample(12:20,20,replace=TRUE),sample(18:22,20,replace=TRUE))
groups<-factor(rep(LETTERS[1:3],each=20))
model1<-coxph(Surv(death)~groups)
model1
mat<-matrix(c(1,-1,0,0,1,-1,2,-1,-1),ncol=3,byrow=TRUE,dimnames=list(1:3,levels(groups)))
surv.multcomp(Surv(death),groups,mat,type="coxph")

model2<-survreg(Surv(death)~groups,dist="weibull")
model2
surv.multcomp(Surv(death),groups,mat,type="survreg",distribution="weibull")

Run the code above in your browser using DataLab