Dummy/condiction !!!!

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Dummy/condiction !!!!

Postby belorma87 » Wed Jul 04, 2018 8:09 am

Hi everybody, as a newbie i'm a little bit confused.
I'm trying to design this "mnl-eff" for a pilot, analyzing 4 differnet options.
Problems arrived with EG and ST utilities.
In this two options i need some "constraints", within the choice model attributes [b]ACCPP and WTCCEG[/b can co-exist and when active WTHDEG [b] and CCHDEG[/b] must be zero, not to be considered in the evaluation, and the viceversa .
Similarly in ST when WTHDST is active WTCCST should be zero, and viceversa.
Currently I m not sure how to proceed, i have tried introduce dummies on attributes and condiction but it does not work.

By this way i'll attach the partial sintax that i've created until now.

Code: Select all
Design ?EFFICIENT
;alts= HRV,EG,ST,NM
;rows=12
;con
;eff=(mnl,d)
;model:
U(HRV)=           bprice[-0.5]*PRICE.ref[2.0]      +acch[-0.01]*ACCHR[10,20,30]          +pth[-0.01]*PTHR[5,25,50]                                                                                                                +blkh[-0.01]*BLKHR[10,20,30]+sk%h[-0.01]*SKEHR[0,20,60]/
U(EG)= b1[1.00] +bprice*PRICE.piv[-20%,0%,20%,40%]+acce[-0.01]*ACCPP[5,7,10]+pte[-0.01]*PTEG[10,20,40]+wthde[-0.05]*WTHDEG[60,360,720]+cchde[-0.10]*CCHDEG[3,5,8]+wtcce[-0.01]*WTCCEG[30,60,120]*i1[0.01]*ACCPP*CCHDEG +blke[0.01]*BLKEG[10,20,30]+sk%e[-0.01]*SKEG[0,20,60]/      
U(ST)= b3[1.00]  +bprice*PRICE.piv[-20%,0%,20%,40%]+accs[-0.01]*ACCST[5,7,10] +pts[-0.01]*PTST[5,10,20] +wthds[-0.05]*WTHDST[30,60,180] +cchds[-0.10]*CCHDST[0,2.5,5]+wtccs[-0.05]*WTCCST[30,60,120]+blks[0.01]*BLKST[10,20,30]+sk%s[-0.01]*SKEST[0,20,60]/
U(NM)= b4[1.00]  +bprice*PRICE.piv[-20%,0%,20%,40%]+accn[-0.01]*ACCNM[10,15,20]          +ptn[-0.01]*PTNM[10,25,50]                                                                                                                 +blkn[-0.01]*BLKNM[10,20,30]+sk%n[-0.01]*SKENM[0,20,60]
$


every kind of suggestion and also a review on the written code is well acccepted!
Best regards
belorma87
 
Posts: 4
Joined: Tue Jul 03, 2018 8:23 pm

Re: Dummy/condiction !!!!

Postby johnr » Thu Jul 05, 2018 1:59 am

Hi

Ngene allows you to build constraints. In this case, you will need to add a zero level to the attributes you want to constrain (I am assuming you mean active/inactive to mean the attribute is present or not and if not then it should be 0). The code, based on your description might look as follows.

Code: Select all
Design ?EFFICIENT
;alts= HRV,EG,ST,NM
;rows=12
;con
;eff=(mnl,d)
;cond:
if(EG.ACCPP = 0, EG.WTCCEG =0 and EG.CCHDEG = [3,5,8]),
if(EG.WTCCEG = 0, EG.ACCPP =0 and EG.CCHDEG = [3,5,8]),
if(EG.CCHDEG = 0, EG.ACCPP =[5,7,10] and EG.WTCCEG = [30,60,120]),
if(ST.WTHDST = 0, ST.WTCCST =[30,60,120]),
if(ST.WTCCST = 0, ST.WTHDST =[30,60,180])
;model:
U(HRV)= bprice[-0.5]*PRICE.ref[2.0]     
+ acch[-0.01]*ACCHR[10,20,30]         
+ pth[-0.01]*PTHR[5,25,50] 
+ blkh[-0.01]*BLKHR[10,20,30]
+ sk%h[-0.01]*SKEHR[0,20,60]/

U(EG)= b1[1.00]
+ bprice*PRICE.piv[-20%,0%,20%,40%]
+ acce[-0.01]*ACCPP[0,5,7,10]
+ pte[-0.01]*PTEG[10,20,40]
+ wthde[-0.05]*WTHDEG[60,360,720]
+ cchde[-0.10]*CCHDEG[0,3,5,8]
+ wtcce[-0.01]*WTCCEG[0,30,60,120]*i1[0.01]*ACCPP*CCHDEG
+ blke[0.01]*BLKEG[10,20,30]
+ sk%e[-0.01]*SKEG[0,20,60]/ 
   
U(ST)= b3[1.00] 
+ bprice*PRICE.piv[-20%,0%,20%,40%]
+ accs[-0.01]*ACCST[5,7,10]
+ pts[-0.01]*PTST[5,10,20]
+ wthds[-0.05]*WTHDST[0,30,60,180]
+ cchds[-0.10]*CCHDST[0,2.5,5]
+ wtccs[-0.05]*WTCCST[0,30,60,120]
+ blks[0.01]*BLKST[10,20,30]
+ sk%s[-0.01]*SKEST[0,20,60]/

U(NM)= b4[1.00] 
+ bprice*PRICE.piv[-20%,0%,20%,40%]
+ accn[-0.01]*ACCNM[10,15,20]         
+ ptn[-0.01]*PTNM[10,25,50]                                                                                                               
+ blkn[-0.01]*BLKNM[10,20,30]
+ sk%n[-0.01]*SKENM[0,20,60]
$


John
johnr
 
Posts: 171
Joined: Fri Mar 13, 2009 7:15 am

Re: Dummy/condiction !!!!

Postby belorma87 » Thu Jul 05, 2018 2:43 am

Good afternoon Johnr, first of all thx so much for your kindly attention.
Currently i'm evaluating the functions using "reject", but surely i will follow also your post.

Best regards

Mark
belorma87
 
Posts: 4
Joined: Tue Jul 03, 2018 8:23 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 38 guests

cron