Page 1 of 1

dummy categorical variables

PostPosted: Wed Sep 27, 2023 9:26 pm
by Saraw
Dear Professor,
I am generating choice tasks. I have 2 categorical variables, color (Red=0, yellow=1 , purple= 2 -------> Red=0 base level ) and Method ( con=0, IPM=1, org=2 ------> con=0 base level ) , is it correct to write b1.dummy[0|0]*color[0,1,2]
would you please look if my design is correct?
Many thanks

design
;alts= alt1*, alt2*, optout
;rows= 12
;eff=(mnl,d)
;model:
u(alt1)=b1.dummy[0|0]*color[0,1,2]
+b2.dummy[0]*newtechnique[0,1]
+b3.dummy[0]*functional[0,1]
+b4.dummy[0|0]*method[1,2,0]
+b5*price[4,7,10]/

u(alt2)=b1*color
+b2*newtechnique
+b3*functional
+b4*method
+b5*price/
u(optout)=b6[0]
$

Re: dummy categorical variables

PostPosted: Thu Sep 28, 2023 9:17 am
by Michiel Bliemer
You need to write:

b1.dummy[0|0]*color[1,2,0] ? 0 = base

since the last attribute level in Ngene is always the base level. The first dummy coefficient refers to level 1 and the second dummy coefficient refers to level 2, while base level 0 is normalised to zero utility.

Note that the values you use for the levels are not important, so it is the same as

b1.dummy[0|0]*color[2,3,1] ? 1 = base

Michiel

Re: dummy categorical variables

PostPosted: Thu Sep 28, 2023 6:23 pm
by Saraw
Dear Professor,
thank you so much for your response.