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.
/*
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;
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);
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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.