Dear all,
I would really like to perform a linear mixed effects model in R but have limited maths and computational skill.
I have a matlab Anovan function that does the job but I like doing basic things in R and would like to try the analysis there.

I believe my data is unbalanced and that I would like to perform a crossed analysis (if my self teaching is correct).
My dependent variable ( A) is continuous.
I then have three independent categorical variables (B, C- fixed) (D= random)
My random variable pertains to 'Individual'.

Several people have advised my that the main important thing is that I have included the effects of the random factor interactions with the other fixed factors- for example the advice was…

"try adding the first level interaction terms?  Of particular importance is the interaction between the fixed effect and random effect (BirdNo),  because the correct calculation of the F-statistic for a mixed model should be the MSE of the fixed effect (e.g.
A) over the MSE for the interaction term (e.g.
A*D).    It looks like R doesn't automatically do this if
the model doesn't include the interaction terms."

And someone who uses R suggested:
lmer(A ~ B + C + (1|D), data=emgDat)
lmer(A ~ B + C + (1|D) + (1|D*B*C),data=emgDat)

But when I tried this with lmer it came up with an error.
Am I on the right lines…and can anyone advise me how this analysis differs from using Matlab anovan I would be so grateful.  Plus I really am easily confused by this stuff as it is anything but intuitive for me.. I've read so much on it and am none the wiser.
Thanks for any help,
Jo

[http://www.rvc.ac.uk/cf_images/button_rvc.png]<http://www.rvc.ac.uk>    [http://www.rvc.ac.uk/cf_images/button_twitter.png] <http://twitter.com/RoyalVetCollege>     [http://www.rvc.ac.uk/cf_images/button_facebook.png] <http://www.facebook.com/theRVC>

This message, together with any attachments, is intended for the stated addressee(s) only and may contain privileged or confidential information. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Royal Veterinary College (RVC). If you are not the intended recipient, please notify the sender and be advised that you have received this message in error and that any use, dissemination, forwarding, printing, or copying is strictly prohibited. Unless stated expressly in this email, this email does not create, form part of, or vary any contractual or unilateral obligation. Email communication cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, amended, lost, destroyed, incomplete or contain viruses. Therefore, we do not accept liability for any such matters or their consequences. Communication with us by email will be taken as acceptance of the risks inherent in doing so.

	[[alternative HTML version deleted]]

