# [R] Nested ANOVA with covariates

Martin Hoyle plxmh at nottingham.ac.uk
Mon Apr 15 18:45:53 CEST 2002

```Dear All,
I'm rather a beginner on nested ANOVAs, so here goes with my 2
questions;

Qu 1:
I'm modelling the number of galls on a leaf (the response variable) as
a function of;
the tree on which I find the leaf,
the branch on which I find the leaf.

Then, the tree and the branch are both random factors, and I'm quite
happy that I should write;

aov(galls~tree/branch + Error(tree/branch))

But, I'd also like to introduce the size of the leaf as a covariate.
I'm not sure how I can do this in R. Any suggestions?

Qu 2:
I'm measuring the stress response of some tiny worms (the response
variable) by the effect of the presence of absence of cadmium (a fixed
factor), and by the presence of absence of an electric field (a fixed
factor). This would normally be a straight forward 2 way anova;

But, I have the complication that I have nesting. I have 4 reps for
each combination of cadmium and electic field. Within each of these 4
reps, I have pseudoreplication. Specifically, I have 3 reps within each
of the 4 main reps. In detail, worms are held in little wells in plates
(random factor). I have 4 plates for each combination of cadmium and
electic field. These are geniune reps. Within each plate, there are 3
pseudoreps. I thought I could model this as;

I don't really know what to put in the error.

Thanks v much for your time.

Regards,
Martin.

Martin Hoyle,
School of Life and Environmental Sciences,
University of Nottingham,
University Park,
Nottingham,
NG7 2RD,
UK
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```