[R] lme nesting/interaction advice

From: Federico Calboli <f.calboli_at_imperial.ac.uk>
Date: Thu, 08 May 2008 17:32:00 +0100

Hi everyone,

I am confused on how to specify some nesting and interaction terma with lme().

I have a dataset where some flies where selected for accessory gland size, made to mate in presence/absence of another male and the level of some protein measured. Now the complex stuff.

The selection has been replicated twice, so that the selection term has got two levels (large and small) with replicates large1/large2 and small1/small2.

A second complication comes from the fact the experiment has been replicated three times at three different months, in two blocks for each months.

In allthen I have

selection (fixed) with 2 levels
line%in%selection (random) with 4 levels (2 large, 2 small) number of males (fixed) and continuous
replica (random) with 3 levels
block%in%replica (random) with 6 levels (2 for each month).

The easiest model ignores the nested random effects and uses just selection, males and replica and the relative interactions. The model

lme(y ~ selection * males, random = ~1|replica/selection/males, mydata)

gives and anova table

                 numDF denDF  F-value p-value
(Intercept)         1   228 870.5669  <.0001
selection           1     2   0.2393  0.6731
males               1     4   0.0228  0.8874
selection:males     1     4   0.0941  0.7744

where the denDF for males and selection:males are wrong (it should be 2 in both cases). So my model is wrongly specified.

To sum it up, how would I model the 3 possible interactions between replica, selection and males?

and if I had the masochistic desire to add to the model line%in%selection and block%in%replica, how could I model that?



Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602     Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 08 May 2008 - 17:27:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 09 May 2008 - 10:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive