On Jul 30, 2010, at 11:08 AM, Biau David wrote:

Hello,

I would like to get the likelihood ratio and score tests for specific variables in a multivariate coxph model. The default is Wald, so the tests for each separate variable is based on Wald's test. I have the other tests for the full
model but I don't know how to get them for each variable.

Any idea?


The first idea would be to specify which function in which package you are asking questions about. In the case of coxph in the survival package, for instance, you do get a likelihood ratio test (== differences in log-likelihoods) by default. A score test is, at least as as I understand it for individual variables, equivalent to a Wald test, so I don't really understand your question, since youa re already getting all of that in the survival package.

(You can extract a "score" value and loglik values from a coxph object by:
(with the first example in the coxph help page)

 coxph(Surv(time, status) ~ x + strata(sex), test1)$score
xoxph(Surv(time, status) ~ x + strata(sex), test1)$loglik

But anova(coxph-object) would give you these values in a neater bundle.
#Analysis of Deviance Table
# Cox model: response is Surv(time, status)
#Terms added sequentially (first to last)
#      loglik  Chisq Df Pr(>|Chi|)
# NULL -3.8712
# x    -3.3277 1.0871  1     0.2971

The question about "getting them for each variable" does not make a lot of sense to me, since likelihood tests are model comparisons. You can only make such statements about the consequences of adding or deleting a variable to/from an existing model.

--
David Winsemius, MD
West Hartford, CT

______________________________________________
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.

Reply via email to