Categorical Variable

294 views
Skip to first unread message

mdmosab...@gmail.com

unread,
Sep 7, 2018, 1:02:03 PM9/7/18
to Biogeme
Hi All,

I am just wondering how can I define 6 age categories in an MNL.

I know that if there are 3 categories, I need to prepare 2 dummy variables but how does it work in Pythonbiogeme.

For instance, I have considered the following 3 categories 

B_AGE_01= Beta('B_AGE_01',0,-10,10,0, 'AGE_01')
B_AGE_02= Beta('B_AGE_02',0,-10,10,0, 'AGE_02')
B_AGE_03= Beta('B_AGE_03',0,-10,10,0, 'AGE_03')

AGE_01 = DefineVariable('AGE_01', AGE == 1 or AGE == 2)
AGE_02 = DefineVariable('AGE_02', AGE == 3 or AGE == 4)
AGE_03 = DefineVariable('AGE_03', AGE == 5 or AGE == 6)


If I specify this in the utility specification model, it runs and I get results. But, my question is how to explain the Beta here as I haven'y specified any base category (which should be fixed)?

Can anyone please explain me how to specify these categories. I already have looked into nestedestimation provided in the biogeme website but couldn't able to figure it out.

Thanks very much.

Best,
Mosabbir

Michel Bierlaire

unread,
Sep 11, 2018, 8:20:27 AM9/11/18
to mdmosab...@gmail.com, Michel Bierlaire, Biogeme
There is an online course that explains this in detail.
Week 4 covers pythonbiogeme. 
Week 5 covers model's specification. 
In particular, this video https://youtu.be/CIYTq_r5JLA 



--
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To post to this group, send email to bio...@googlegroups.com.
Visit this group at https://groups.google.com/group/biogeme.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages