Hi everyone,
I am trying to run a hierarchical bayes model on a choice based conjoint analysis with the following attributes and -levels (this is just an example to make the explanation easier):
Att1: Color
Att1Lv1: Red
Att1Lv2: Blue
Att2: Size
Att2Lv1: small
Att2Lv2: large
The raw data is dummy coded: 1 for a present attribute and 0 for not-present. 1 for a yes choice and 0 for a no choice.
I am using the following code:
ods graphics on;
proc bchoice data=CSDesignEffect outpost=EffectPost
nmc=500 thin=2 seed=123
nthreads=4
Hitprob;
class red blue small large
None
N Set;
model choice=
red blue small large
/ choiceset=(Set);
preddist covariates=CSDesignEffect nalter=5 outpred=Predout;
/ subject=N;
run;
Now I am trying to specify the reference attribute levels which are supposed to be "blue" and "large". I tried the command ref=last but it wouldn't work - for some reason SAS shows parameter estimates for blue which should actually be "0" since they are the reference. For "large" it seems to work.
My second question: SAS shows either zeros, ones or nothing behind the parameters in the summary. E.g. "Red 0", "Blue 0", "small 0", "large 0". What does this mean?
Thank you very much for your help.
Best,
Alex
Change your CLASS statement to:
class color (ref='blue') size(ref='large');
I can't find any reference to the CLASS variable 'None'--you might consider dropping it from the list. This would leave your MODEL statement as
MODEL choice = color size / choiceset = (set);
You should now get estimates in the output. If not, then you should provide a few lines of your dataset and the output listing.
Steve Denham
Dear Mr. Denham,
thank you so much for your answer.
My data input table looks like this:
N | RespID | Set | Alt | Choice | None | Product | Red | Blue | Small | Large | Price |
1 | 3 | 121 | 1 | 0 | 0 | 481 | 1 | 0 | 1 | 0 | 200 |
1 | 3 | 121 | 2 | 1 | 0 | 482 | 1 | 0 | 0 | 1 | 300 |
1 | 3 | 121 | 3 | 0 | 0 | 483 | 0 | 1 | 1 | 0 | 400 |
1 | 3 | 121 | 4 | 0 | 0 | 484 | 0 | 1 | 0 | 1 | 200 |
1 | 3 | 121 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
So e.g. Respondent "3" sees 5 alternatives in Choice Set "121" where alternative 5 is the no choice option (Choice Based Conjoint).
As already said, the attribute levels are dummy coded: 1 if the level is present, 0 if not. The price is linear and can be directly copied into the choice set coding.
In this example, respondent "3" chooses the second alternative in the choice set. This alternative is "Red" and "Large" at a price of 300.
As you can see, there actual attributes (color and size) are not included in the coding. So how would you proceed in this case?
Thank you very much for your help.
Best,
Alex
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.