Programming the statistical procedures from SAS

Proc bchoice - Reference attribute levels

Reply
Contributor
Posts: 20

Proc bchoice - Reference attribute levels

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

Respected Advisor
Posts: 2,655

Re: Proc bchoice - Reference attribute levels

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

Contributor
Posts: 20

Re: Proc bchoice - Reference attribute levels

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

Ask a Question
Discussion stats
  • 2 replies
  • 205 views
  • 0 likes
  • 2 in conversation