LR.test: Likelihood ratio test for Weibull as a submodel of the...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/AFTlrtest.R

Description

Likelihood ratio test for Weibull as a submodel of the exponentiated Weibull or generalized gamma model.

Usage

1
LR.test(fit)

Arguments

fit

a list of two survreg.aft fits: one must be the Weibull fit and the other one is the exponentiated Weibull or generalized gamma fit.

Details

The log-likelihood values from the two fits are used for the likelihood ratio test.

Value

chi.sq: chi-square test statistic.

p value: p value.

Author(s)

Shahedul Khan <khan@math.usask.ca>

See Also

survreg.aft, rresid.plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  library(frailtypack)
  data(readmission)
# Recoding sex and chemo
  sex<-factor(2-as.numeric(readmission$sex),
       labels=c("Female","Male"))
  chemo<-factor(as.numeric(readmission$chemo)-1,
         labels=c("NonTreated","Treated"))
  Data<-readmission
  Data$sex<-sex
  Data$chemo<-chemo
  fit.gg<-survreg.aft(c(t.start,t.stop,event)~sex+chemo+charlson,
      Data=Data,model="ggamma")
  fit.ew<-survreg.aft(c(t.start,t.stop,event)~sex+chemo+charlson,
      Data=Data,model="eweibull")
  fit.w<-survreg.aft(c(t.start,t.stop,event)~sex+chemo+charlson,
      Data=Data,model="weibull")
  LR.test(list(fit.w,fit.ew))
  LR.test(list(fit.w,fit.gg))

sa4khan/AFTjmr documentation built on March 12, 2020, 1:24 a.m.