Am 11/19/2013 9:39 AM, schrieb andrea.onofri@unipg.it:
> Dear all,
>
> I am trying to fit a simple model, relating to a randomised block design where both blocks (A) and treatments (B) are random effects. Coding in lmer, this model would be:
>
> model <- lmer(Y ~ 1 + (1|A) + (1|B))
>
> However, I would also like to be able to 'manipulate' the correlation structure and thus I assume I have to revert to the lme function in the nlme package. In other cases I have been able to fit non-nested effects in lme by appropriately using the pdMat construct, but, after several efforts, I do not seem to succeed in this simple case. I would greatly appreciate any hints that puts me in the right direction. I thank you very much in advance.
>
> Regards
>
> Andrea Onofri
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Hello,

if I understand correctly, you want to specifiy multiple but non-nested 
random effects? If so, I recently found a post on statsExchange where 
someone has found a solution. I didn't check it though, but perhaps it 
fits your needs:

|fit<-  lme(Y~  time,  random=list(year=~1,  date=~time),  data=X,  weights=varIdent(form=~1|year))

or adapted to your general lmer example

||fit<-  lme(Y~  1,  random=list(A=~1,  B=~1),  data=X,  weights=varIdent(form=~1|A))||

You can read the details here:

http://stats.stackexchange.com/questions/58669/specifying-multiple-separate-random-effects-in-lme

Perhaps that works (didn't check it myself, yet)

Greetings
|

-- 
Friso Muijsers

Institute for Chemistry and Biology of the Marine Environment (ICBM)
Carl-von-Ossietzky University Oldenburg
Schleusenstrasse 1
26382 Wilhemshaven


	[[alternative HTML version deleted]]

