[R] lme nesting/interaction advice
Federico Calboli
f.calboli at imperial.ac.uk
Thu May 8 18:32:00 CEST 2008
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?
Chers,
Federico
--
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
More information about the R-help
mailing list