BookmarkSubscribeRSS Feed
ahoeweler
Calcite | Level 5

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

2 REPLIES 2
SteveDenham
Jade | Level 19

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

ahoeweler
Calcite | Level 5

Dear Mr. Denham,
thank you so much for your answer.

My data input table looks like this:

NRespIDSetAltChoiceNoneProductRedBlueSmallLargePrice
131211004811010200
131212104821001300
131213004830110400
131214004840101200
13121501 00000
  
  

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

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!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1482 views
  • 0 likes
  • 2 in conversation