BookmarkSubscribeRSS Feed
TimB
Calcite | Level 5

We inherited a experimental design which we want to evaluate.

In reading the materials by Warren Kuhfeld at  http://support.sas.com/resources/papers/tnote/tnote_marketresearch.html on the various SAS macros, it does seem that SAS would be appropriate for evaluating designs with something like the %ChoicEff macro. It seems this is used after generating designs to evaluate then, and we just want to enter our own design and get the characteristics of this (such at the efficincy scores). 

Entering the design and following the examples from his guides, I would hope something like the following would work.: 

--------------------------------------------------------------------------- 

data final;

input f1 f2 x1 x2 x3 x4 x5;

datalines;

2 2 0 0 1 0 1

2 2 0 0 2 2 1

2 2 0 1 3 3 0

2 2 0 2 0 1 0

2 2 1 0 0 3 1

2 2 1 0 3 1 1

2 2 1 1 2 0 0

2 2 1 2 1 2 0

2 2 3 0 0 0 0

2 2 3 0 3 2 0

2 2 3 1 1 1 1

2 2 3 2 2 3 1

2 2 4 0 1 3 0

2 2 4 0 2 1 0

2 2 4 1 0 2 1

2 2 4 2 3 0 1

;

proc print data=final(obs=16); run;

%choiceff(data=final,             /* candidate set of choice sets */

init=design,                     /* initial design */

initvars=x1-x5,                 /* factors in the initial design */

intiter=0,                         /* evaluate without internal iterations */

model=class(x1-x5 / sta),         /* model with stdzd orthogonal coding */

nsets=6,                         /* 6 choice sets */

nalts=3,                         /* 3 alternatives per set */

options=relative,                 /* display relative D-efficiency */

beta=zero)                         /* assumed beta vector, Ho: b=0 */

--------------------------------------------------------------------------- 

However, we are getting errors for this and variations on it.

Thanks for any help!

Tim 

7 REPLIES 7
art297
Opal | Level 21

It would help if you showed your log indicating the errors you got.  Out of curiosity, do you license SAS/Stat and
SAS/IML?  I noticed that there appear to be a number of calls to those components.

TimB
Calcite | Level 5

Thank you.

The log file upon running this shows:

--------------------------------------------------------------

NOTE: SAS initialization used:

      real time           1.11 seconds

      cpu time            0.57 seconds

1    data final;

2    input f1 f2 x1 x2 x3 x4 x5;

3    datalines;

NOTE: The data set WORK.FINAL has 16 observations and 7 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

20   ;

21   proc print data=final(obs=16); run;

NOTE: There were 16 observations read from the data set WORK.FINAL.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.04 seconds

      cpu time            0.01 seconds

22

23   %choiceff(data=final,           /* candidate set of choice sets */

24   init=design,                    /* initial design */

25   initvars=x1-x5,                 /* factors in the initial design */

26   intiter=0,                      /* evaluate without internal iterations */

27   model=class(x1-x5 / sta),       /* model with stdzd orthogonal coding */

28   nsets=6,                        /* 6 choice sets */

29   nalts=3,                        /* 3 alternatives per set */

30   options=relative,               /* display relative D-efficiency */

31   beta=zero)                      /* assumed beta vector, Ho: b=0 */

ERROR: File WORK.DESIGN.DATA does not exist.

WARNING: The data set WORK.__TMPCINITDAT may be incomplete.  When this step was stopped there were

         0 observations and 0 variables.

ERROR: The CHOICEFF macro ended abnormally.

NOTE: The CHOICEFF macro used 0.04 seconds.

-------------------------------------------------------------------------------------

As for the SAS/Stat & SAS/IML components, we have a site licence for SAS and I believe it is comprehensive and includes these. (They look familiar.) 

Thank you,
Tim

art297
Opal | Level 21

I'm not familiar with the set of macros, but you are clearly missing a file that it wants, namely, a file called work.design.  Did you run the %MktEx macro?  It looks like it may have to be run first and might create the missing file.

TimB
Calcite | Level 5

I was trying to replace the design generation from the %MktEx macro with the inpuitting of my own. 

Perhaps I have to enter this as a file "work.design"?  Would this be straightforward? 

Thank you,
Tim

art297
Opal | Level 21

I'll have to leave answering your question to someone who is familiar with the macros.  As long as you know what the variables and formats the file is supposed to have, I would guess that it could/should be straightforward.

TimB
Calcite | Level 5

Thank you.  Appreciate the insights.  Will keep trying to use the documentation and working with these macros.

meatweaver
Calcite | Level 5

This works for me:

data actual;

input x1 x2 x3 x4;

datalines;

1 1 1 2

1 1 2 1

1 1 2 2

1 2 1 1

1 2 1 2

1 2 2 1

1 2 2 2

2 1 1 1

2 1 1 2

2 1 2 2

2 2 1 2

2 2 2 1

;

proc print data=actual(obs=12); run;

%mkteval(data=actual)

%choiceff(data=actual,

          init=Actual,

          initvars=x1-x4,

          intiter=0,

          model=class(x1-x4 / sta),

          nsets=1,

          nalts=12,

          beta=zero)

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1284 views
  • 1 like
  • 3 in conversation