[R] lm type of sums of squares

2005-10-28 Thread Jarrett Byrnes
I'm curious, I realize there are methods for Type II and III sums of squares, and yet, when I've been constructing models with lm, I've noticed that position of the term of the model has not mattered in terms of its p-value. Does lm use sequential Type I sums of squares, or something else?

Re: [R] lm type of sums of squares

2005-10-28 Thread John Fox
Dear Jarrett, anova() gives sequential sums of squares (as ?anova.lm says). See Anova() in the car package for something similar to Type II and III sums of squares. I hope this helps, John On Fri, 28 Oct 2005 10:05:39 -0700 Jarrett Byrnes [EMAIL PROTECTED] wrote: I'm curious, I realize there

Re: [R] lm type of sums of squares

2005-10-28 Thread Liaw, Andy
anova.lm() gives the sequential tests: set.seed(1) dat - data.frame(y=rnorm(10), x1=runif(10), x2=runif(10)) anova(lm(y ~ x1 + x2, dat)) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F value Pr(F) x1 1 1.1483 1.1483 2.0943 0.1911 x2 1 0.4972 0.4972