Hi,

thanks. I am indeed interested in the main effects of A and B and their

interaction+ I want to incorporate C (the block or 'repetition' within which

the A and B treatments were applied) as a random variable. So A*B would be

the way, however errors of A and B are different due to different

experimental plot sizes. When doing Anova the correct code should be this: 

summary(aov(ln_response) ~ A*B + Error(rep/A), data=Exp2)

in which case the effect of A is calculated by using error A*rep

and the effect of B and A*B is calculated using pooled error of B*rep and

A*B*rep

This I dont know how to specify in glmer. Maybe 'nesting' is not a right

term to use (?)


 > To: r-h...@stat.math.ethz.ch
> From: bbol...@gmail.com
> Date: Fri, 18 Jan 2013 14:07:02 +0000
> Subject: Re: [R] Nesting fixed factors in lme4 package
> 
> Martina Ozan <martina_ozan <at> hotmail.com> writes:
> 
> > Hi, can anyone tell me how to nest two fixed factors using glmer in
> > lme4? I have a split-plot design with two fixed factors - A (whole
> > plot factor) and B (subplot factor), both with two levels. I want to
> > do GLMM as I also want to include different plots as a random
> > factor. But I am interested on the effect of A a B and their
> > interaction on the response variable. I tried
> > this:glmer(response~A*B+(A/B)+(1|C),data=Exp2,family=poisson but it
> > gives the same output as if I removed (A/B) all together or used
> > (A:B) instead thus the output is the same as:
> > glmer(response~A*B+(1|C),data=Exp2,family=poisson anyone can help
> > with how I define this nesting, so that data are analysed correctly
> > given my split-plot design? thanks, Martina
> 
>   In general mixed model questions should go to 
> r-sig-mixed-mod...@r-project.org , but this is actually *not*
> specifically a mixed model problem.  If A and B are fixed factors,
> you're typically interested in A*B, which translates to 1+A+B+A:B,
> i.e. intercept; main effects of A and of B; and the interaction.
> The nesting syntax A/B translates to 1 + A + A:B, i.e. no main
> effect of B.  Nesting would typically make more sense in a random-effects
> context where the meaning of "B=1 in unit A=1" is different from
> "B=1 in unit A=2", i.e. where you don't want or it doesn't make
> sense to estimate a main effect of B across levels of A.
> 
>   Ben Bolker
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to