[R] question about mixed effects model

About this list Date view Thread view Subject view Author view Attachment view

From: Albedo (albedo@pisem.net)
Date: Mon 01 Mar 2004 - 18:28:13 EST


Message-id: <4042E60D.9090201@pisem.net>

Hello.

I have some trouble with mixed effects in R, similar to problems
that other people had with not nested models and lme, as I
understand from the mailing list archive. Unfortunately, I could
not understand the solutions that were proposed...

I have a data set with response variable (y) and two explanatory
variables x1 and x2 (x1 - fixed factor, x2 - random factor). Fixed
factor x1 is repeated twice for each x2 value.

I believe that the correct way to fit a mixed model would be

ddd <- groupedData(y ~ x1 | x2, dd)
l1 <- lme(y ~ x1, random = pdBlocked(list(pdIdent(~x2-1))), data = ddd)

But I get an error
Error in pdConstruct.pdBlocked(object, form = form, nam = nam, data =
data, : None of the arguments specify more than one block

I would also have to test for significance of each variable (x1 and x2)
and the way to do this seem to be to fit a model without x1 and compare
it to the original l1 model (and then the same for x2), but I can't seem
to find a way to do this.

Thanks a lot.

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Fri 23 Apr 2004 - 18:36:27 EST