BookmarkSubscribeRSS Feed
tompatmck
Fluorite | Level 6

Hello, 

 

I'm analyzing data from a randomized complete block design replicated at multiple sites.  There is only one treatment and the block effect at each site.  I plan on using proc mixed with block as a random effect.  I'm wondering if block should be nested within each site?  And what else should go in the random effects?

 

proc mixed ;
class site block treatment ;
model biomass = site|treatment;
random block(site);
run;

 

Thanks.

 

5 REPLIES 5
Ksharp
Super User
/*
Check the first example of PROC MIXED in its documentation.
Example 84.1: Split-Plot Design
*/


data sp;
input Block A B Y @@;
datalines;
1 1 1 56 1 1 2 41
1 2 1 50 1 2 2 36
1 3 1 39 1 3 2 35
2 1 1 30 2 1 2 25
2 2 1 36 2 2 2 28
2 3 1 33 2 3 2 30
3 1 1 32 3 1 2 24
3 2 1 31 3 2 2 27
3 3 1 15 3 3 2 19
4 1 1 30 4 1 2 25
4 2 1 35 4 2 2 30
4 3 1 17 4 3 2 18
;

proc mixed;
class A B Block;
model Y = A B A*B;
random Block A*Block;
run;


/* equivalent model */
proc mixed data=sp;
class A B Block;
model Y = A B A*B;
random intercept A / subject=Block;
run;
tompatmck
Fluorite | Level 6
Should all blocks be uniquely identifiable across sites in the data? For
example, there should not be a block 1 at Site X and a block 1 at Site Y?
Site X would have blocks 1 -4 and Site Y would have blocks 4-8, instead of
blocks 1-4 at both sites?

Thanks for the help.
Ksharp
Super User
"Should all blocks be uniquely identifiable across sites in the data? "
Yes. It should be unique . You could take a BLOCK as a SUBJECT ID .
If it is not unique, you should nested it by siteid. Like:

random intercept siteid / subject=Block(siteid);
StatsMan
SAS Super FREQ

That RANDOM statement is almost right. If you have block 1-4 in site A and block 1-4 in site B then you do need to nest block within site. Your RANDOM statement could be 

 

random block(site); 

or

random int / subject=block(site);

tompatmck
Fluorite | Level 6

Thanks for all the help.

 

Just to clarify: 

 

If I have blocks identified as 1 through 4 at multiple sites, then block is nested within site and not listed on it's own in the random term.  My random term would be as below:

 

proc mixed;

class site block treatment;

model response = site|treatment;

random block(site);

 

If all blocks have a unique identifier across sites, block would be included on it's own and the random term would be;

 

proc mixed;

class site block treatment;

model response = site|treatment;

random block block*site;

 

 

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1126 views
  • 6 likes
  • 3 in conversation