BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Bikram09
Calcite | Level 5
I have run these codes but in the last step the choice sets are not coming in blocks






%MktRuns(3 3 3 3 2 2)
%MktEx (3 3 3 3 2 2, n=36)
proc print; run;

%macro res;
do i = 1 to nalts;
do k = i + 1 to nalts;
if all(x[i,] >= x[k,]) then bad = bad + 1; /* alt i dominates alt k */
if all(x[k,] >= x[i,]) then bad = bad + 1; /* alt k dominates alt i */
end;
end;
%mend;



%choiceff(data=design,
model=class(x1-x6/sta),
nsets=36,
flags=2,
seed=123,
options=relative,
beta=zero);
proc print; var x1-x6; id set; by set; run;
proc format;
value x1f 1 = 'Crop-specific advice'
2 = 'Weather forecasting'
3 = 'Market price and trend information';
value x2f 1 = 'SMS'
2 = 'Internet'
3 = 'Face to face';
value x3f 1 = 'Within 24 hours'
2 = 'Weekly'
3 = 'Monthly updates';
value x4f 1 = 'Free of cost'
2 = '₹100 per month'
3 = '₹300 per month';
value x5f 1 = 'Government extension services'
2 = 'Private extension services' ;
value x6f 1 = 'General'
2 = 'Based on farm-level data';
run;

proc print label;
label x1 = 'Type of Service'
x2 = 'Service Delivery Mode'
x3 = 'Response Time'
x4 = 'Cost of Service';
x5 = 'Service Provider Type'
x6 = 'Customization of Advice'
format x1 x1f. x2 x2f. x3 x3f. x4 x4f. x5 x5f. x6 x6f. ;
by set;
id set;
var x1-x6;
title "Formatted Choice Sets with Labels";
run;


proc print data=bestcov label;
title ’Variance-Covariance Matrix’;
id __label;
label __label = ’00’x;
var x:;
run;
%mktblock(data=best,
nblocks=4,
out=blocked_design,
seed=114)
title;
%mktdups(generic,
data=best,
factors=x1-x6,
nalts=2)
1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Ammonite | Level 13

You have misplaced semicolons in your LABEL statement, but that is not what you are asking about.

 

When I run your code, I see blocks. Just print the output data set.

 

Not sure why you are running MktDups on the Best data set.

View solution in original post

3 REPLIES 3
WarrenKuhfeld
Ammonite | Level 13

You have misplaced semicolons in your LABEL statement, but that is not what you are asking about.

 

When I run your code, I see blocks. Just print the output data set.

 

Not sure why you are running MktDups on the Best data set.

Bikram09
Calcite | Level 5

Thank you, Sir, for the solution. Is there a specific suitability parameter for D-efficiency? Should D-efficiency exceed a particular threshold or value to be considered acceptable?

WarrenKuhfeld
Ammonite | Level 13

Every thing that I have ever known or had to say on that topic is here.  https://support.sas.com/techsup/technote/mr2010c.pdf

I'm pretty proud of this work. Parts are pretty technical, but it explains a lot.

 

The shortest answer I can give you is: No.

 

D-efficiency depends on so many things: how you coded, what mix of levels you have how many choice sets, how many alternatives, restrictions, and others. I like to show "toy" examples where all those things perfectly come together to make perfect designs. Even then, they are only perfect for the beta vector you specified, typically all zeros. Most of the time, we don't have toy examples and have no earthly idea how much D-efficiency can range for any particular problem.

 

Things to consider:
Can you estimate every parameter of interest?

If not, why not. With certain types of restrictions, you can never estimate everything that you can without them.

How do your variances look? This is probably the key question. If they are wildly big, you might need more choice sets or a richer candidate set.

I don't have time now to rerun your analysis, but I don't recall seeing any red flags when I did.

If you post the variance results, I'll look at them later and comment.

 

Finally, let me say that you are asking a good question. I encourage you to look around in the article I mentioned for more help.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 780 views
  • 0 likes
  • 2 in conversation