>Is there a function in the survival package that will allow me to test a >subset >of independent variables for joint significance? I am thinking along the >lines >of a Wald, likelihood ratio, or F-test. I am using the survreg procedure to >estimate my parameters. Thank you.
The most direct is to use a likelihood ratio test. However, be careful about deletions due to missing! > fit1 <- survreg(Surv(time, status) ~ age + ph.ecog, lung) > fit2 <- update(fit1, .~ .+ meal.cal + wt.loss) > 2*(fit2$log - fit1$log)[2] # wrong -- different sample sizes > tdata <- na.omit(lung[, c('time', 'status', 'ph.ecog', 'age', 'wt.loss', > 'meal.cal') > fit1 <- survreg(Surv(time, status) ~ age + ph.ecog, tdata) > fit2 <- update(fit1, .~ .+ meal.cal + wt.loss) > 2*(fit2$log - fit1$log) #this will be chisq on 2 df [2] [1] 1.014557 >anova(fit1, fit2) nicer format, but wide for this email so omitted Terry Therneau ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.