- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
/*
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;