Re: [Rd] problem in add1's F statistic when data contains NAs?

2013-05-17 Thread Paul Johnson
Bill I think you are correct, there's something funny in add1, but is it just degrees of freedom? Example below.. On Tue, May 14, 2013 at 2:23 PM, William Dunlap wdun...@tibco.com wrote: Shouldn't the F statistic (and p value) for the x2 term in the following calls to anova() and add1() be

[Rd] problem in add1's F statistic when data contains NAs?

2013-05-14 Thread William Dunlap
Shouldn't the F statistic (and p value) for the x2 term in the following calls to anova() and add1() be the same? I think anova() gets it right and add1() does not. d - data.frame(y=1:10, x1=log(1:10), x2=replace(1/(1:10), 2:3, NA)) anova(lm(y ~ x1 + x2, data=d)) Analysis of Variance Table