The PLAN Procedure

Example 87.2 A Hierarchical Design

(View the complete code for this example.)

In this example, three plants are nested within four pots, which are nested within three houses. The FACTORS statement requests a random permutation of the numbers 1, 2, and 3 to choose Houses randomly. The second step requests a random permutation of the numbers 1, 2, 3, and 4 for each of those first three numbers to randomly assign Pots to Houses. Finally, the FACTORS statement requests a random permutation of 1, 2, and 3 for each of the 12 integers in the second set of permutations. This last step randomly assigns Plants to Pots. The following statements produce Output 87.2.1:

title 'Hierarchical Design';
proc plan seed=17431;
   factors Houses=3 Pots=4 Plants=3 / noprint;
   output out=nested;
run;

proc print data=nested;
run;

Output 87.2.1: A Hierarchical Design

Hierarchical Design

ObsHousesPotsPlants
1132
2133
3131
4113
5111
6112
7122
8123
9121
10143
11142
12141
13241
14243
15242
16222
17221
18223
19232
20233
21231
22212
23213
24211
25341
26343
27342
28313
29312
30311
31321
32322
33323
34333
35332
36331