[Limdep Nlogit List] Heuristics & latent classes using Maximize in nlogit 5. How can I take into account the quasi-panel structure of experiment?

Damien Jourdain djourdain at ait.asia
Wed Jun 21 14:22:17 AEST 2017


Dear List members,

Sorry for the long message, but this is to describe the different steps before reaching my problem!

We are analyzing a choice experiment using Nlogit5. 
? MNL Model
NLOGIT; 
    ; Choices = 1,2,3
    ; Lhs = Choice
    ; Rhs = SQ , BEN10, LAB10, CAS10, RISK10, ST, FERTHI, FERTLO
$

During the interviews, we had noticed that many respondents tended to eliminate the alternative when FERTLO = 1 and FERTHI = 0  (in fact FERT is a nominal variable that we effect coded into FERTLO and FERTHI), we would like to test whether the heuristic is present in the population.  I have looked at the Hensher et al. 2015, Applied choice analysis book and came out with the following procedures. (but I am using Nlogit 5 so far)

First I checked that I could use Maximize to reproduce the simple MNL.

Sample; All$
create; ch0 = Choice; ch1 = Choice[+1]; ch2 = Choice[+2]$
create; ben0 = ben10; ben1 = ben10[+1]; ben2 = ben10[+2]$
create; lab0 = lab10; lab1 = lab10[+1]; lab2 = lab10[+2]$
create; cas0 = cas10; cas1 = cas10[+1]; cas2 = cas10[+2]$
create; sto0 = st;    sto1 = st[+1];    sto2 = st[+2]$
create; fhi0 = ferthi; fhi1 = ferthi[+1]; fhi2 = ferthi[+2]$
create; flo0 = fertlo; flo1 = fertlo[+1]; flo2 = fertlo[+2]$
create; J = Trn(-3, 0)$
reject; J > 1$

Namelist; 
	x0 =  ben0, lab0, cas0, sto0, fhi0, flo0; 
	x1 =  ben1, lab1, cas1, sto1, fhi1, flo1; 
	x2 =  ben2, lab2, cas2, sto2, fhi2, flo2 $
Calc; ks = Col(x0)$
Matrix; cs = init(ks,1,0.1) $


Maximize 
 ; labels = interc, ks_bs
 ; start  = 0.1, cs
 ; maxit = 30
 ; Fcn = 
ut0 = interc+ bs1'x0  |  v0 = exp(ut0) |
ut1 = bs1'x1  |   v1 = exp(ut1) |
ut2 = bs1'x2 |v2 = exp(ut2) |
IV =  v0+ v1 + v2 |
P = ( ch0*v0 + ch1*v1 + ch2*v2)/ IV |
log(P) ; 
Output=1$

It gave the same results. 

Then I produced an Indicator variable  (being equal to zero when the fertlo is present. It helps me modify the utility functions so that the utility of one alternative is equal to zero when the attribute is present.

create; I1=1$  
create; I2=1$
create; if(flo1=1 & fhi1= 0)I1=0$
create; if(flo2=1 & fhi2= 0)I2=0$


Maximize 
 ; labels = intercep, ks_bs
 ; start  = 0.1, cs
? ; maxit = 30
 ; Fcn = 
ut0 = intercep+ bs1'x0  |  v0 = exp(ut0) |
ut1 = I1 * (bs1'x1)  |   ? the utility is becoming null when the fertlo indicator is present in the alternative
v1 = exp(ut1) |
ut2 = I2*(bs1'x2) | v2 = exp(ut2) |
IV =  v0+ v1 + v2 | P = ( ch0*v0 + ch1*v1 + ch2*v2)/ IV |
log(P) ; 
Output=1$

Finally I am trying to develop a latent class analysis so that I can identify whether the two types of heuristics are present in the sample.
? Latent class analysis

Calc; ks2 = Col(x0)$
Matrix; cs2 = init(ks2,1,0.1) $

Maximize 
 ; labels = inter, ks_ba, inter2, ks2_bb, gamma 
 ; start  = 0.1, cs, 0.1, cs2, 0.1
 ; maxit  = 30
 ; Fcn = 
ut0c1 = inter+ ba1'x0  |  v0c1 = exp(ut0c1) |
ut1c1 = ba1'x1  |v1c1 = exp(ut1c1) |
ut2c1 = ba1'x2 |v2c1 = exp(ut2c1) |
IVc1 =  v0c1+ v1c1 + v2c1 |
Pc1 = ( ch0*v0c1 + ch1*v1c1 + ch2*v2c1)/ IVc1 |

ut0c2 = inter2+ bb1'x0  | v0c2 = exp(ut0c2) |
ut1c2 = I1 * (bb1'x1)  | v1c2 = exp(ut1c2) |
ut2c2 = I2*(bb1'x2) | v2c2 = exp(ut2c2) |
IVc2 =  v0c2+ v1c2 + v2c2 |
Pc2 = ( ch0*v0c2 + ch1*v1c2 + ch2*v2c2)/ IVc2 |

Pprob = 1 / (1+exp(gamma))|
P = Pprob * Pc1 + (1-Pprob) * Pc2 |
log(P) ; 
Output=1$

While the model is running ok, I realize that I am not taking into account the fact that respondents are actually answering 6 choice sets (quasi-panel?), but I cannot find a meaningful way to write that using Maximize ?  Anybody already faced this kind of issue?  


Best, 


Damien 


Dr. Damien Jourdain
Agricultural and Natural Resources Economist
Visiting Assistant Professor
Asian Institute of Technology / CIRAD G-EAU
Natural Resource Management / Water Engineering and Management

mail: djourdain at ait.asia

web GEAU : www.g-eau.net 
web NRM : www.nrm.ait.asia








More information about the Limdep mailing list