# [R] nested anova diagnostics

Leonardo D Bacigalupe L.Bacigalupe at sheffield.ac.uk
Tue Mar 21 15:25:22 CET 2006

```Hello all,

I have two questions regarding nested anova.
I've attached a simple example, where a male is mated with 4 females,
and the intensity of the colour of the eyes is measured in two
offspring from each female.

1) As I understand it, residuals in a nested anova are the difference
between an observed value and the predicted value, which is equal to
the sample mean for the cell that contains that observed value (e.g.
residual for ind 1 = 58.5 - 59 = -0.5). Therefore for the dataset below
there should be 24 residuals and 24 fitted values, to be used for
diagnostics, etc.

As I read on Venables & Ripley (4th Edition) pp 279-286, there should
be 4 strata in this experiment
(model<-aov(eye~male/female+Error(male/female)): (i) one corresponding
to the total of all observations, (ii) one corresponding to contrasts
between male totals, (iii) one corresponding to contrasts between
females and (iv) the residual stratum. Residual and fitted values for
this model can be obtained from resid(model[[4]]) and
fitted(model[[4]]) (pp 284 V&R). Given this, could someone please
explain me how fitted values are calculated in this case? There seems
that Heiberger 1989 (in V&R) offers some explanation, but unfortunately
the library does not have the book, or someone around.

2) In the present case, there seems that fitted(model[[4]]) are all 0.
Is there any particular reason for this result?
[,1]
13    0
14    0
15    0
16    0
17    0
18    0
19    0
20    0
21    0
22    0
23    0
24    0

eye male female
58.5    1      1
59.5    1      1
77.8    1      2
80.9    1      2
84.0    1      3
83.6    1      3
70.1    1      4
68.3    1      4
69.8    2      1
69.8    2      1
56.0    2      2
54.5    2      2
50.7    2      3
49.3    2      3
63.8    2      4
65.8    2      4
56.6    3      1
57.5    3      1
77.8    3      2
79.2    3      2
69.9    3      3
69.2    3      3
62.1    3      4
64.5    3      4

Thanks

Leonardo

Leonardo D. Bacigalupe

Department of Animal and Plant Sciences
University of Sheffield
Sheffield S10 2TN
United Kingdom

L.Bacigalupe at sheffield.ac.uk

```