[R] linear mixed model with nested factors

Doran, Harold HDoran at air.org
Mon Mar 7 19:42:29 CET 2011


David:

It is unlikely you will get a helpful response to this. Instead, you will improve your chances of a good response if you do three things:

1) Provide a mathematical description of the model you are trying to estimate
2) Provide a description of the data you have
3) Provide some code or any efforts you have made with the lmer function so far.

For example, for (1) you might provide something like, "I want a model as"

y_ji = mu + beta(x) + u_j + e_ij

where x is ...

For (2) You can show your data structure as:

> str(myData)

And for (3) just indicate what you have done so far. For example, I have tried

> lmer(response ~ covariate + (1|covariate), myData)



> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of David Dudek
> Sent: Monday, March 07, 2011 1:29 PM
> To: r-help at r-project.org
> Subject: [R] linear mixed model with nested factors
> 
> Hi R-help.
> 
> I am trying to run a linear mixed model with nested factors with either
> lme or lmer and I am having no luck obtaining the same results as Minitab.
> Here is Minitab's code:
> 
> MTB > GLM 'count' = site year replicate(site year) site*year;
> SUBC>   Random 'year' 'replicate';
> 
> Can you tell me how to code this in R?
> 
> The settings are typeII, Tukey, 95%confidence interval, but I know how to
> set those in R.
> 
> I have basic R skills and I've worked with this on and off for several
> days, and have also consulted some people with basic R experience, but
> nobody can get it to work as it seems to be a bit complex. I'd prefer to
> use R rather than Minitab for the research project I'm working on, but the
> time spent on this problem has gotten to be too much.
> 
> Thanks in advance.
> 
> Sincerely,
> David
> student - Norway
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list