The %MktBlock autocall macro blocks a choice design or an ordinary linear experimental design. The %MktBlock macro tries to create a blocking factor that is uncorrelated with every attribute of every alternative. That is, it tries to make a factor that is orthogonal to all the attributes of all the alternatives.
The input design can be in one of two formats: a choice design or a linear arrangement. A choice design has one row for each alternative of each choice set and one column for each of the attributes. The %ChoicEff and %MktRoll macros generate this kind of design. A linear arrangement is an intermediate step in preparing some choice designs. The linear arrangement has one row for each choice set and one column for each attribute of each alternative. The %MktEx macro generates linear arrangements. The output from the %MktBlock macro is a data set that contains the design, with runs or choice sets nested within blocks.
%MktBlock(NBLOCKS=n, <, optional arguments>)
You can specify either of the following to display the option names and simple examples of the macro syntax:
%mktblock(help) %mktblock(?)
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;
When a choice design is too large to show all choice sets to each subject, the design can be blocked and a block of choice sets can be shown to each subject. For example, if you have 27 choice sets, instead of showing each subject 27 sets, you can create three blocks and show three groups of subjects 9 choice sets each. The following statements create a linear version of a choice design by using the %MktEx macro, and then block the design by using the %MktBlock macro:
%mktex(3 ** 6, n=27, seed=350)
By default, the %MktEx macro saves a randomized version of the design that it creates in a data set named Randomized
:
%mktblock(data=Randomized, nblocks=3, seed=377, maxiter=50)
The DATA= argument specifies that the design to be blocked is contained in the data set Randomized
. The NBLOCKS= argument creates three blocks. The MAXITER= argument requests 50 attempts to block the design with different random starts. The SEED= argument ensures reproducibility.
Figure 1 shows that the blocking factor is uncorrelated with all the factors in the design. This output comes from the %MktEval macro, which is called by the %MktBlock macro.
Figure 1: %MktBlock Macro Output
Summary of Frequencies |
There are 0 Canonical Correlations Greater Than 0.316 |
Frequencies | ||
---|---|---|
Block | 9 9 9 | |
x1 | 9 9 9 | |
x2 | 9 9 9 | |
x3 | 9 9 9 | |
x4 | 9 9 9 | |
x5 | 9 9 9 | |
x6 | 9 9 9 | |
Block x1 | 3 3 3 3 3 3 3 3 3 | |
Block x2 | 3 3 3 3 3 3 3 3 3 | |
Block x3 | 3 3 3 3 3 3 3 3 3 | |
Block x4 | 3 3 3 3 3 3 3 3 3 | |
Block x5 | 3 3 3 3 3 3 3 3 3 | |
Block x6 | 3 3 3 3 3 3 3 3 3 | |
x1 x2 | 3 3 3 3 3 3 3 3 3 | |
x1 x3 | 3 3 3 3 3 3 3 3 3 | |
x1 x4 | 3 3 3 3 3 3 3 3 3 | |
x1 x5 | 3 3 3 3 3 3 3 3 3 | |
x1 x6 | 3 3 3 3 3 3 3 3 3 | |
x2 x3 | 3 3 3 3 3 3 3 3 3 | |
x2 x4 | 3 3 3 3 3 3 3 3 3 | |
x2 x5 | 3 3 3 3 3 3 3 3 3 | |
x2 x6 | 3 3 3 3 3 3 3 3 3 | |
x3 x4 | 3 3 3 3 3 3 3 3 3 | |
x3 x5 | 3 3 3 3 3 3 3 3 3 | |
x3 x6 | 3 3 3 3 3 3 3 3 3 | |
x4 x5 | 3 3 3 3 3 3 3 3 3 | |
x4 x6 | 3 3 3 3 3 3 3 3 3 | |
x5 x6 | 3 3 3 3 3 3 3 3 3 | |
N-Way | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 | |
1 1 1 1 1 1 1 1 |
Figure 2 displays the blocked linear arrangement (three blocks of nine choice sets).
Figure 2: %MktBlock Macro Output
In the linear version of the design, there is one row for each choice set, and all the attributes of all the alternatives are in the same row.
This example creates and blocks a choice design that has two blocks of nine choice sets. The following statements create a choice design by using the %MktEx, %MktRoll, and %ChoicEff macros:
%mktex(3 ** 6, n=3**6) %mktroll(design=design, key=2 3, out=out) %choiceff(data=out, model=class(x1-x3 / sta), nsets=18, nalts=2, seed=151, options=nodups relative, beta=zero)
By default, the %ChoicEff macro saves the choice design in a data set named Best
. The following statement blocks the design by using the %MktBlock macro:
%mktblock(data=best, nalts=2, nblocks=2, factors=x1-x3, seed=472)
The DATA= argument specifies that the design to be blocked is contained in the data set Best
. The NALTS= argument specifies that each choice set contains two alternatives, and by implication, that the input data set is a choice design and not a linear arrangement. The NBLOCKS= argument creates two blocks. The FACTORS= argument specifies that the factors in the design are represented by the variables X1
, X2
, and X3
. The SEED= argument ensures reproducibility.
Figure 3 shows the canonical correlations between the factors. The variable names in the output are composed of Alt
, the alternative number, and the factor name. Because there are two alternatives, each composed of three factors plus one blocking variable, a correlation matrix is reported. The results indicate that the design and the blocking are not as good as in the previous example.
Figure 3: %MktBlock Macro Output
Canonical Correlations Between the Factors |
There are 9 Canonical Correlations Greater Than 0.316 |
Block | Alt1_x1 | Alt1_x2 | Alt1_x3 | Alt2_x1 | Alt2_x2 | Alt2_x3 | |
---|---|---|---|---|---|---|---|
Block | 1 | 0.25 | 0.14 | 0.14 | 0.15 | 0 | 0.14 |
Alt1_x1 | 0.25 | 1 | 0.45 | 0.36 | 0.69 | 0.35 | 0.31 |
Alt1_x2 | 0.14 | 0.45 | 1 | 0.12 | 0.21 | 0.58 | 0.33 |
Alt1_x3 | 0.14 | 0.36 | 0.12 | 1 | 0.31 | 0.43 | 0.52 |
Alt2_x1 | 0.15 | 0.69 | 0.21 | 0.31 | 1 | 0.56 | 0.21 |
Alt2_x2 | 0 | 0.35 | 0.58 | 0.43 | 0.56 | 1 | 0.29 |
Alt2_x3 | 0.14 | 0.31 | 0.33 | 0.52 | 0.21 | 0.29 | 1 |
Canonical Correlations > 0.316 Between the Factors |
There are 9 Canonical Correlations Greater Than 0.316 |
r |
r Square |
||
---|---|---|---|
Alt1_x1 | Alt2_x1 | 0.69 | 0.48 |
Alt1_x2 | Alt2_x2 | 0.58 | 0.34 |
Alt2_x1 | Alt2_x2 | 0.56 | 0.31 |
Alt1_x3 | Alt2_x3 | 0.52 | 0.27 |
Alt1_x1 | Alt1_x2 | 0.45 | 0.20 |
Alt1_x3 | Alt2_x2 | 0.43 | 0.18 |
Alt1_x1 | Alt1_x3 | 0.36 | 0.13 |
Alt1_x1 | Alt2_x2 | 0.35 | 0.13 |
Alt1_x2 | Alt2_x3 | 0.33 | 0.11 |
Summary of Frequencies |
There are 9 Canonical Correlations Greater Than 0.316 |
* - Indicates Unequal Frequencies |
Frequencies | ||
---|---|---|
Block | 9 9 | |
* | Alt1_x1 | 9 8 1 |
* | Alt1_x2 | 6 5 7 |
* | Alt1_x3 | 6 7 5 |
* | Alt2_x1 | 3 4 11 |
Alt2_x2 | 6 6 6 | |
* | Alt2_x3 | 6 5 7 |
* | Block Alt1_x1 | 4 4 1 5 4 0 |
* | Block Alt1_x2 | 3 2 4 3 3 3 |
* | Block Alt1_x3 | 3 4 2 3 3 3 |
* | Block Alt2_x1 | 2 2 5 1 2 6 |
Block Alt2_x2 | 3 3 3 3 3 3 | |
* | Block Alt2_x3 | 3 2 4 3 3 3 |
* | Alt1_x1 Alt1_x2 | 3 4 2 3 1 4 0 0 1 |
* | Alt1_x1 Alt1_x3 | 3 4 2 3 2 3 0 1 0 |
* | Alt1_x1 Alt2_x1 | 0 4 5 2 0 6 1 0 0 |
* | Alt1_x1 Alt2_x2 | 3 3 3 2 3 3 1 0 0 |
* | Alt1_x1 Alt2_x3 | 3 3 3 3 2 3 0 0 1 |
* | Alt1_x2 Alt1_x3 | 2 2 2 2 2 1 2 3 2 |
* | Alt1_x2 Alt2_x1 | 1 2 3 1 1 3 1 1 5 |
* | Alt1_x2 Alt2_x2 | 0 3 3 2 0 3 4 3 0 |
* | Alt1_x2 Alt2_x3 | 2 2 2 2 2 1 2 1 4 |
* | Alt1_x3 Alt2_x1 | 1 2 3 2 1 4 0 1 4 |
* | Alt1_x3 Alt2_x2 | 2 3 1 2 1 4 2 2 1 |
* | Alt1_x3 Alt2_x3 | 0 3 3 3 0 4 3 2 0 |
* | Alt2_x1 Alt2_x2 | 1 0 2 1 3 0 4 3 4 |
* | Alt2_x1 Alt2_x3 | 1 1 1 2 1 1 3 3 5 |
* | Alt2_x2 Alt2_x3 | 1 2 3 3 1 2 2 2 2 |
N-Way | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 |
Because the input data set is a choice design, the results shown in Figure 4 are in choice design format; there is one row for each alternative of each choice set.
Figure 4: %MktBlock Macro Output