dummy categorical variables

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

dummy categorical variables

Postby Saraw » Wed Sep 27, 2023 9:26 pm

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]
$
Saraw
 
Posts: 10
Joined: Mon Sep 18, 2023 7:40 pm

Re: dummy categorical variables

Postby Michiel Bliemer » Thu Sep 28, 2023 9:17 am

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
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Re: dummy categorical variables

Postby Saraw » Thu Sep 28, 2023 6:23 pm

Dear Professor,
thank you so much for your response.
Saraw
 
Posts: 10
Joined: Mon Sep 18, 2023 7:40 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: Bing [Bot], jamalm and 40 guests