The %MktMerge autocall macro merges a data set that contains a choice design with choice data.
%MktMerge(DESIGN=SAS-data-set, NALTS=n, NSETS=n, SETVARS=variable-list <, optional arguments>)
You can specify either of the following to display the argument names and simple examples of the macro syntax:
%mktmerge(help) %mktmerge(?)
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 shows a typical example of using this macro:
%mktmerge(design=rolled, data=results, out=res2, nsets=18, nalts=5, setvars=choose1-choose18)
The DESIGN= data set comes from the %MktRoll macro. The DATA= data set contains the response data, and the SETVARS= variables in the DATA= data set contain the numbers of the chosen alternatives for each of the 18 choice sets. The NSETS= argument specifies the number of choice sets, and the NALTS= argument specifies the number of alternatives. The OUT= argument names the output SAS data set that contains the experimental design and the variable C
, which contains 1 for the chosen alternatives (first choice) and 2 for unchosen alternatives (second or subsequent choice).
When the DATA= data set contains a blocking variable, you specify its name in the BLOCKS= argument. When there is blocking, it is assumed that the DESIGN= data set contains blocks of nalts nsets observations. The BLOCKS= variable must contain the values 1, 2,
,
for
blocks. The following example uses the %MktMerge macro with blocking:
%mktmerge(design=rolled, data=results, out=res2, blocks=form, nsets=18, nalts=5, setvars=choose1-choose18)