Page 1 of 1

dummy variable

PostPosted: Wed Nov 03, 2021 5:05 pm
by Chavez
Dear Prof.Michiel Blimer,

I did a pilot study; my size sample is 108 (18 respondents who answered six choice task). Now I am trying to estimate the prior in Nlogit through of multinomial logit. But I have a problem; two of my four attributes are variable dummy with four-level each one. So, when I ran the model in Nlogit and tried to use all variables, I got the following error: Error 135: Models - singular Hessian during Newton iterations. I just only can run the model by omitting one level of some of one dummy variable.

My design is unlabelled; and it have four attribute with four level each one:
land: 75,50, 25,10. (dummy variable than represent four kind of percentages of forest)
livestock= four type of livestock= intes, silvo, ext; semi_ext (dummy variable)
willingness to pay(wp)= 0, 2000, 4000, 16000
jaguar: 0,2,5,9


this is an example of my data matriz than I ´m using in Nlogit
alti Id choice land_75 land_50 land_25 land_10. intes. silvo. ext. semi_ext. wp jaguar
alt_1. 1 1 1 0 0 0 0 1 0 0 0 5
alt_2. 1 0 0 0 0 0 0 1 0 0 2000 2
alt3. 1 0 0 0 0 0 0 1 0 0 4000 0
alt_1. 2. 0 1 0 0 0 0 1 0 0 0 5
alt_2. 2 1 0 0 0 0 0 1 0 0 2000 2
alt3. 2 0 0 0 0 0 0 1 0 0 4000 0

alt= alternative of choosing
id= respondents
choice= choose


I appreciate the you can give some orientation about my problem. Thank you very much for you time.

Re: dummy variable

PostPosted: Wed Nov 03, 2021 7:18 pm
by Michiel Bliemer
Dummy coding of 4 levels means that you create 3 variables and estimate 3 parameters. Adding the fourth variable makes the model overidentified.

First, you choose which level you want to use as the base level. It does not matter which one you select, so suppose that for livestock I select the following:

level 1: intes (base)
level 2: silvo
level 3: ext
level 4: semi_ext

Then this will be coded as follows:

Code: Select all
intes:    0  0  0
silvo:    1  0  0
ext:      0  1  0
semi_ext: 0  0  1


This means that you estimate a parameter associated with silvo, with ext and with semi_ext, while intes is the base. If the parameter for silvo is larger than 0, then this means that silvo is prefered RELATIVE TO intes.

Michiel

Re: dummy variable

PostPosted: Fri Nov 05, 2021 6:22 pm
by Chavez
Thank you, I was reading about this in the book Applied Choice Analysis, and I can see that they use -1 instead of zero, and they use -1 in one of the alternatives for all levels. It is the same, use code effect in all levels for one alternative, although my design is unlabelled?

In another hand, when I try to run a model Mlogit using the next expression: MLOGIT;Lhs=CHOICE
;Rhs=LAND,INTENS,SILVO,SEMI_EXT,EXTENS,WP_1,WP_2,WP_3,WP_4
,JAG$

The result is always as[code][/code] binary choice; I have not found a way to fix this problem in my database so that Nlogit recognizes my data for a multinomial model. my data in Nlogit look like these:


altern id alti cset choice landS.a intens silvo semi_ext extens wp_1 wp_2 wp_3 wp_4 jag
alt1 1 1 1 6 0 75 0 0 1 0 0 1 0 0 2
alt2 1 1 1 6 0 10 0 1 0 0 0 0 1 0 5
alt3 1 1 1 6 1 50 0 0 1 0 0 1 0 0 5


my n is 18 (id), and every people responded six choice task, with three alternatives (alt1, alt2,alt3),

choice= represents the selected alternative. and the remaining columns represent my attribute

thank you very much

Re: dummy variable

PostPosted: Sat Nov 06, 2021 8:15 am
by Michiel Bliemer
I think that you are mixing up things. If the base levels use -1 then it is called effects coding, not dummy coding, which looks like:

Code: Select all
intes:    -1  -1  -1
silvo:     1   0   0
ext:       0   1   0
semi_ext:  0   0   1


Further, dummy and effects coding is used to code attribute levels, not alternatives. So there is no relationship with labelled or unlabelled experiments, it can be used for attributes in any experiment.

I cannot help you with model estimation in Nlogit as I do not use Nlogit myself, I can only help you with experimental design and Ngene.
I suggest that you post your question on the Nlogit discussion group: https://www.limdep.com/listserver/

Michiel