The %MktBSize autocall macro suggests sizes for balanced incomplete block designs (BIBDs). The sizes that it reports are sizes that meet necessary, but not sufficient, conditions for the existence of a BIBD, so a BIBD might not exist for every reported size.
Note: The version of the %MktBSize macro that is documented here requires SAS 9.01 or any subsequent release. An enhanced version of the %MktBSize macro is included in the SAS 940m3 maintenance release. The enhanced version requires SAS 940m1 or any subsequent release. The documentation for the enhanced version of the macro is published at http://support.sas.com/rnd/app/macros/MktBSize/mktbsize.htm.
The parameters of a BIBD are as follows:
specifies the number of blocks. In a partial-profile design, this is the number of profiles. In a MaxDiff design, this is the number of sets.
specifies the number of treatments. In a partial-profile or MaxDiff design, this is the total number of attributes or messages.
specifies the block size, which is the number of treatments in each block. In a partial-profile or MaxDiff design, this is the number of attributes or messages that are shown at one time.
If and are integers, and and , then a complete block design might be possible. This is a necessary but not sufficient condition for the existence of a complete block design. If and are integers, and and , then a balanced incomplete block design might be possible. This is a necessary but not sufficient condition for the existence of a BIBD.
%MktBSize(K=do-list, T=do-list <, optional arguments>)
You can specify either of the following to display the option names and simple examples of the macro syntax:
%mktbsize(help) %mktbsize(?)
This macro specifies options nonotes
throughout most of its execution. If you want to see all the notes, submit the following statement before running the macro:
%let mktopts = notes;
To see the macro version, submit the following statement before running the macro:
%let mktopts = version;
The following invocation of the %MktBSize macro requests a list of designs that have 12 treatments, between 4 and 8 treatments per block, and between 12 and 30 blocks:
%mktbsize(t=12, k=4 to 8, b=12 to 30)
The results are shown in Figure 1.
Figure 1: %MktBSize Output
You can use this information to create a BIBD by using the %MktBIBD macro as follows:
%mktbibd(t=12, k=6, b=22, seed=104)
There is no guarantee that the %MktBIBD macro will find a BIBD for any specification, but in this case it does, and it finds the design shown in Figure 2.
Figure 2: BIBD with T=12, K=6, B=22
Balanced Incomplete Block Design |
x1 | x2 | x3 | x4 | x5 | x6 |
---|---|---|---|---|---|
7 | 9 | 3 | 10 | 12 | 2 |
5 | 2 | 4 | 6 | 10 | 7 |
5 | 10 | 12 | 9 | 11 | 8 |
7 | 9 | 11 | 12 | 1 | 4 |
12 | 3 | 4 | 5 | 9 | 10 |
10 | 6 | 9 | 11 | 2 | 1 |
3 | 8 | 7 | 1 | 9 | 6 |
2 | 10 | 12 | 6 | 8 | 1 |
9 | 7 | 6 | 4 | 8 | 5 |
1 | 12 | 5 | 7 | 6 | 11 |
12 | 1 | 2 | 3 | 5 | 7 |
8 | 4 | 1 | 10 | 7 | 12 |
6 | 2 | 9 | 8 | 12 | 4 |
4 | 7 | 11 | 3 | 10 | 6 |
11 | 5 | 1 | 2 | 4 | 9 |
11 | 3 | 2 | 8 | 7 | 9 |
6 | 11 | 8 | 5 | 3 | 12 |
3 | 6 | 10 | 9 | 1 | 5 |
2 | 4 | 6 | 12 | 11 | 3 |
1 | 8 | 10 | 11 | 4 | 3 |
4 | 1 | 3 | 2 | 5 | 8 |
10 | 5 | 8 | 7 | 2 | 11 |
The design has B=22 blocks (rows), K=6 treatments per block (columns), and T=12 treatments (the entries are the integers 1 to 12). Each of the T=12 treatments occurs R=11 times, and each treatment occurs in a block with every other treatment =5 times.
The following invocation of the %MktBSize macro creates a list of more than 50 designs:
%mktbsize(t=5 to 20, k=3 to t - 1, b=t to 30)
Figure 3 shows a partial listing of the results.
Figure 3: %MktBSize Output
By default, the maximum number of replications is 1 (MAXREPS=1). Therefore, the design in which T=5, K=3, and B=20 is not listed because it consists of two replications of the design in which T=5, K=3, and B=10, which is listed. Also, the number of blocks (b=t to 30
) is specified so that it is never less than the number of treatments. Furthermore, the number of treatments per block (k=3 to t-1
) is specified to always be less than the number of treatments. Even more complicated expressions are permitted. For example, to limit the number of treatments per block to no more than half of the number of treatments, you could specify
%mktbsize(t=2 to 10, k=2 to 0.5 * t, b=t to 10)
To limit the number of blocks as a function of the number of treatments, you could specify
%mktbsize(t=2 to 10, k=2 to t - 1, b=t to 2 * t)
However, if you want to limit the number of treatments as a function of the number of blocks, you need to use the ORDER= argument to ensure that the number of blocks loop comes first, as in the following specification:
%mktbsize(b=2 to 10, t=2 to 0.5 * b, k=2 to t - 1, order=btk)
The macro reports sizes in which and are integers, , and . If and are integers, and and , then a complete block design might be possible. This is a necessary, but not sufficient, condition for the existence of a complete block design. If and are integers, and and , then a balanced incomplete block design might be possible. This is a necessary, but not sufficient, condition for the existence of a BIBD. If you specify OPTIONS=UBD and is an integer, then the %MktBSize macro reports unbalanced block design sizes along with BIBD sizes. For example, if you want a design that has 20 treatments and a block size of 6, you can use the following invocation of the %MktBSize macro to find out how many blocks you need:
%mktbsize(t=20, k=6, options=ubd)
Figure 4 displays the results.
Figure 4: %MktBSize Output
You can then use the %MktBIBD macro to find a design in which each treatment occurs three times but the treatments do not appear together an equal number of times, as in the following example:
%mktbibd(t=20, k=6, b=10, seed=104)
Figure 5 shows the treatment by treatment frequencies and the design.
Figure 5: %MktBIBD Output
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 3 | 1 | 0 | 0 | 2 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 1 |
2 | . | 3 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 2 | 1 |
3 | . | . | 3 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 2 | 2 | 1 | 1 | 0 |
4 | . | . | . | 3 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 2 | 0 |
5 | . | . | . | . | 3 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 0 | 1 | 0 |
6 | . | . | . | . | . | 3 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 |
7 | . | . | . | . | . | . | 3 | 1 | 0 | 0 | 2 | 2 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 |
8 | . | . | . | . | . | . | . | 3 | 1 | 1 | 1 | 1 | 2 | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
9 | . | . | . | . | . | . | . | . | 3 | 1 | 0 | 1 | 2 | 0 | 1 | 1 | 1 | 1 | 0 | 2 |
10 | . | . | . | . | . | . | . | . | . | 3 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 1 | 1 |
11 | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 1 | 2 | 1 | 0 | 1 | 1 | 0 | 1 |
12 | . | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 |
13 | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
14 | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 1 | 1 | 1 | 0 | 1 |
15 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 0 | 1 | 1 | 1 | 1 |
16 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 1 | 1 | 0 |
17 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 1 | 1 |
18 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 1 | 2 |
19 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 | 0 |
20 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 3 |