Date: Wed, 14 Nov 2007 16:04:20 -0500
Reply-To: Sharif Aly <saly@UCDAVIS.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sharif Aly <saly@UCDAVIS.EDU>
Subject: SAS code for crossed random effects
Dear list,
Would anyone please explain to me how to indicate several random effects
crossed in a multilevel model?
My model has no fixed effects (other than intercept) and 4 random effects
levels: level 4 crossed with level 3 which in turn is crossed with level 2
which is nested in level 1?
Level 4: farm
Level 3: location (location is nested in farm)
Level 2: time (time is crossed with location)
Level 1: collector (collector is crossed with time)
My code (the last 2 lines were my attempt to imply the crossed factors):
proc mixed data=pcr;
class time farm collector location;
model pcr= /solution;
random intercept / subject= farm;
random intercept / subject=location (farm);
random intercept / subject= time (location farm);
repeated collector/ sub=time*location (farm) type=vc;
Best regards,
Sharif