[R] Unbalanced Mixed Linear Models With Nested Stratum

JaFF el.romaro at gmail.com
Wed Feb 9 13:19:13 CET 2011


In human words, we the random effects can be described as follows:
We believe that the variability comes from each subject behaving uniquely at
each period and from each eye of each subject at each period behaving
uniquely.

As far as the crash, I've compiled a structurally-similar dataset (without
all the names, etc.) and made fake data for the response variable. So please
find the file attached. This should be reported to the R developers, I
supose.
http://r.789695.n4.nabble.com/file/n3297130/crash_data_3.csv
crash_data_3.csv 
The model called: fit = lmer(resp ~ (subject + period + treatment):eye +
(eye|subject:period), data=sub) 

Hi dunner,
I got a pdf of the book, thank you for the advice. I will take me a while to
digest all the info in there. 

...

I think I managed to get it right. I used the "lme" function from the "nlme"
package. I've combined the subject and period variables into a new variable
called "SP" and used the call 
lme(resp ~ (subject + period + treatment)*eye, random=~ 1|SP/eye, data =
sub)
Which explots the fact that a "/" in the random effects will take the
entries separated by it in heirarchical order and their combinations. So it
gives me "SP" and "eye %in% SP"... the anova table and the summary seem to
be correct. I just need my supervisor to check the result and then I can
move on.

Thanks for all the help. :)
-- 
View this message in context: http://r.789695.n4.nabble.com/Unbalanced-Mixed-Linear-Models-With-Nested-Stratum-tp3263969p3297130.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list