[R] Trouble Computing Type III SS in a Cox Regression using drop1 and Anova

John Fox jfox at mcmaster.ca
Wed Apr 24 20:31:27 CEST 2013


Dear Paul,

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Paul Miller
> Sent: Wednesday, April 24, 2013 1:18 PM
> To: r-help at r-project.org
> Subject: [R] Trouble Computing Type III SS in a Cox Regression using
> drop1 and Anova
> 
> Hello All,
> 
> Am having some trouble computing Type III SS in a Cox Regression using
> either drop1 or Anova from the car package. Am hoping that people will
> take a look to see if they can tell what's going on.
> 
> Here is my R code:
> 

. . .

> 
> Both drop1 and Anova give me a different p-value than I get from coxph
> for both my two-level ps2 variable and for age. This is not what I
> would expect based on experience using SAS to conduct similar analyses.
> Indeed SAS consistently produces the same p-values. Namely the ones I
> get from coxph.
> 
> My sense is that I'm probably misusing R in some way but I'm not sure
> what I'm likely to be doing wrong. SAS prodcues Wald Chi-Square results
> for its type III tests. Maybe that has something to do with it.
> Ideally, I'd like to get type III values that match those from coxph.
> If anyone could help me understand better, that would be greatly
> appreciated.

You've answered your own question: The summary() output gives you Wald
tests, and drop1() and Anova() give you LR tests. From ?Anova:

"test.statistic: ... for a Cox model, whether to calculate "LR"
(partial-likelihood ratio) or "Wald" tests; ..."

Thus, if you want the Wald test, you can ask for it (though it escapes me
why you prefer it to the LR test).

I hope this helps,
 John

-----------------------------------------------
John Fox
Senator McMaster Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada



More information about the R-help mailing list