Well, obviously, I don't NEED lmer to analyze this little dataset. But I think it's true that those who teach statistics often give examples of simple cases to show how the dots connect, when moving to more complex cases; and that was the purpose of my question. I guess the answer is that the dots really don't connect (well, they do for the F tests but not the sums of squares). And the suggestion is made that the sums of squares are not an important thing to look at.

This begs the question of whether the sums of squares should even be displayed if they have no interpretation. From the movie "Field of Dreams" comes the quote: "If you build it, they will come." In parallel to that, I'll say: "If you print it, they will ask." And I was just asking.

Russ

Russell V. Lenth  -  Professor Emeritus
Department of Statistics and Actuarial Science
The University of Iowa  -  Iowa City, IA 52242  USA
Voice (319)335-0712 (Dept. office)  -  FAX (319)335-3017

On 9/18/2013 1:46 PM, Douglas Bates wrote:
If you have a small, balanced data set of the sort that occurs in textbooks you are probably better off using a traditional anova analysis method.  Trying to generalize all the anova concepts to REML or ML fits of linear mixed-effects models is very difficult, and perhaps pointless.  I think that the capabilities of software like lme4 are of value for the cases where the anova methods break down, which means anything other than small, perfectly balanced data sets .  Think of REML/ML estimation as an alternative to anova methods but not an exact replacement.

If you haven't already done so, read Bill Venables "Exegeses on Linear Models".  As he says, there really is only one way to think of an analysis of variance or any other statistical hypothesis test which is as a comparison of fits of two nested models to the observed data.  Fisher's remarkable geometric visualization abilities which him to translate statistical concepts into geometric concepts and to create computational shortcuts for the comparisons in the case of perfectly balanced cases.  He realized that the typical agronimist would not react well to linear algebra concepts in n-dimensional response spaces and provided methods for hand computation of the quantities of interest that work in the case of perfectly balanced data.  Unfortunately we have lost sight of the fact that the goal is comparing the fits of different nested models to the data and instead consider the goal as being the calculations of sums of squares and degrees of freedom, even in the cases where they don't make sense.


On Wed, Sep 18, 2013 at 1:04 PM, Lenth, Russell V <russell-lenth@uiowa.edu<mailto:russell-lenth@uiowa.edu>> wrote:
Perhaps this has been answered some time ago, but if so I don't know,
and couldn't find a way to efficiently search the archive.
Consider the following small fake dataset:

> foo <- expand.grid(A=c("a1","a2","a3"), B=c("b1","b2"), rep=1:3)
> cell.means <- c(20,23,23, 16,17,18)
> set.seed(1234567)
> foo$y <- rnorm(18, mean=rep(cell.means,3), sd=5)

I will consider A fixed and B random. Depending on whether they are
crossed or nested, we get the following standard analyses.

> foo.2way <- lmer(y ~ A + (1|B) + (1|A:B), data=foo)
> foo.nest <- lmer(y ~ A + (1|A:B), data=foo)

Now compare the ANOVA tables:

> anova(foo.2way)
Analysis of Variance Table
  Df Sum Sq Mean Sq F value
A  2 95.613  47.807  1.9603

> anova(foo.nest)
Analysis of Variance Table
  Df Sum Sq Mean Sq F value
A  2   68.5   34.25  1.4044

If I were doing the analysis the old-fashioned way, I'd have the same
SS(A)  in both of these models;
yet they are different here. Moreover, thje value of SS(A) from hand
calculations is 136.547 -- different
from either ANOVA table above. Here are the calculations using lm:

> anova(lm(y ~ A*B, data = foo))
Analysis of Variance Table

Response: y
          Df  Sum Sq Mean Sq F value Pr(>F)
A          2 136.547  68.274  2.7996 0.1005
B          1  76.182  76.182  3.1238 0.1026
A:B        2  69.657  34.828  1.4281 0.2777
Residuals 12 292.647  24.387

I can verify that for the crossed model, I get F = 68.274/34.828 - 1.96;
and for the nested model,
I pool B and A:B together for a MS of 48.613 (3 df) and hence an F ratio
of 1.40. So in the anova output for lmer, the F ratios match up, but the
sums of squares are scaled somehow. Why is this?

Russ

Russell V. Lenth  -  Professor Emeritus
Department of Statistics and Actuarial Science
The University of Iowa  -  Iowa City, IA 52242  USA
Voice (319)335-0712 (Dept. office)  -  FAX (319)335-3017


_______________________________________________
R-sig-mixed-models@r-project.org<mailto:R-sig-mixed-models@r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



	[[alternative HTML version deleted]]

