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
Federico Calboli <f.calboli <at> imperial.ac.uk> writes:> > Hi everyone, > > I am confused on how to specify some nesting and interaction terma with lme(). > > lme(y ~ selection * males, random = ~1|replica/selection/males, mydata)Note that random can be a list: "a one-sided formula of the form ~x1+...+xn, or a pdMat object with a formula (i.e. a non-NULL value for formula(object)), or a list of such formulas or pdMat objects. " Dieter
> > Note that random can be a list: > > "a one-sided formula of the form ~x1+...+xn, or a pdMat object with a formula > (i.e. a non-NULL value for formula(object)), or a list of such formulas or pdMat > objects. "If you can translate that into *informative* English I'd be grateful. I have the Pinheiro and Bates book under my nose now, and I suspect it's pretty more extensive that the helpfile, but it's still nowhere close to providing a straigtforward answer to my question. Cheers, 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
On 12 May 2008, at 09:29, Dieter Menne wrote:> Federico: > > First, mixed models are different from "standard 101 Anova", and > quite a lot > of the nesting stuff I used to ponder about 30 year ago when I started > teaching this is no longer relevant and works implicitely when you > code the > parameters correctly. > > >>> with effect3 being random (all all the jazz that comes from this >>> fact). I > fully apprecciate that the only reasonable F-tests would be for > effect1, > effect2 and effect1:effect2, but there is no way I can use lme to > specify > such simple thing without getting the *wrong* denDF. >> > > Good to know that you are sure what is "right"; probably == SAS. > Since most > people active in the lme-business have read > > http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests > > http://finzi.psych.upenn.edu/R/Rhelp02a/archive/76742.html > > > carefully, you might be rather lonely.I will. While I do, feel free to have a look at Appendix A.3 (page App6, at the end of the book) of the Zar 'Biostatistical Analysis', IV ed, second table from the top. That's where I get the feeling for what's right or wrong. I surely cannot get it from SAS because I never had it. I never had the budget for it, so much so I had to lear how to use R from the start because it was free and that was the budget of my department had for stats software All in all, if you feel statistical analysis has moved forth from such humble beginnings (the book I mean, not SAS), and you can convince of that every ref for every paper you submit, please do tell me how you do it, it would be more valuable than knowing how to fit my model. Cheers, 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 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com