The %MktBal autocall macro creates factorial designs by using an algorithm that ensures that the design is perfectly balanced, or when the number of levels of a factor does not divide the number of runs, as close to perfectly balanced as possible. Before using the %MktBal macro, you should try using the %MktEx macro to see whether it makes a design that is balanced enough for your needs. The %MktEx macro can directly create thousands of orthogonal and balanced designs that the %MktBal macro will never find. Even when the %MktEx macro cannot create an orthogonal and balanced design, it usually finds a nearly balanced design. Designs that are created using the %MktBal macro, although perfectly balanced, might be less efficient than designs that are found using the %MktEx macro, and for large problems, the %MktBal macro can be slow.
The %MktBal macro is not a full-featured experimental design generator. For example, you cannot specify interactions that you want to estimate or specify restrictions such as which levels can or cannot appear together. You must use the %MktEx macro for that. The %MktBal macro builds a design by creating a balanced first factor, optimally (or nearly optimally) blocking it to create the second factor, then blocking the first two factors to create the third, and so on. After it creates all factors, it refines each factor. Each factor is in turn removed from the design, and the rest of the design is reblocked, replacing the initial factor if the new design is more D-efficient.
%MktBal(list, N=n <, optional arguments>)
You can specify either of the following to display the option names and simple examples of the macro syntax:
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;
Suppose you want to create a balanced design that contains two 2-level factors and three 3-level factors in 18 runs. The following SAS statement invokes the %MktBal macro to create the design:
%mktbal(2 2 3 3 3, n=18, seed=151)
Figure 1 displays the results. The design that the %MktBal macro generates has a D-efficiency of 99.86 and an average prediction standard error of 0.71. This design is optimal. A 100% efficient design does not exist, because there are two 2-level factors and 18 is not divisible by .
Figure 1: Design Efficiency Measures
The following statements print the resulting design matrix:
proc print data=design noobs; run;
Figure 2 displays the resulting design matrix, which is saved in the data set
Design. By default, the factors in the output data set
Design are named
x3, and so on. You can use the %MktLab macro to conveniently change them.
Figure 2: Design Matrix