I am trying to estimate a discrete choice model, and I have a quick question on how I can structure my attribute variables. My data is in long format, and look like this:
Code:
ID alternative cost Choice attribute1 attribute2 attribute3 attribute4 asc2 asc3 1 1 0 0 1 5 4 1 0 0 1 2 25 1 2 4 3 3 1 0 1 3 50 0 4 1 1 4 0 1 2 1 0 0 1 5 4 1 0 0 2 2 25 1 2 4 3 3 1 0 2 3 50 0 4 1 1 4 0 1 3 1 0 0 1 5 4 1 0 0 3 2 25 1 2 4 3 3 1 0 3 3 50 0 4 1 1 4 0 1
However, my question is how would I be able to estimate models like these by changing the variable structure:
I would like to estimate my model by converting the attributes to a dummy variable since a dummy would better capture the essence of my paper. For instance attribute 1 takes a value between 1 and 5, and I would like to convert it to 4 dummy variable. However, when I convert the attributes to a dummy variable and estimate, the model does not converge and it cannot produce any result. Which I believe is due to lack of variation in the data if I convert the attributes to a dummy variable.
E.g., of codes that does and does not work:
Code:
asclogit Choice cost attribute1 attribute2 attribute3 attribute4 asc2 asc3, case(ID) alternatives(alternative) vce(cluster ID) # This works asclogit Choice cost i.attribute1 i.attribute2 i.attribute3 i.attribute4 asc2 asc3, case(ID) alternatives(alternative) vce(cluster ID) # This DOES NOT work asclogit Choice cost attribute1_dum1 attribute1_dum2 attribute1_dum3 ... attribute4_dum1 asc2 asc3, case(ID) alternatives(alternative) vce(cluster ID) # This DOES NOT work
0 Response to Estimating discrete choice model using continuous v/s binary variables
Post a Comment