Use pivot with effect-coded attribute

This forum is for posts covering broader stated choice experimental design issues.

Moderators: Michiel Bliemer, johnr, Andrew Collins

Use pivot with effect-coded attribute

Postby djourdain » Tue Apr 04, 2017 5:17 pm

Dear all,

I have difficulties to use pivot with effect-coded attributes.
The following design result in an error:

Design
; alts = alt1, alt2, alt3
; rows = 8
; eff = (mnl,d)
; model:
U(alt1) = b1*coutH.ref[100] + b2*wMH.ref[10] + b3.effects*stabRev.ref[2] /
U(alt2) = b0 + b1*coutH.piv[-100 , 0 , 100] + b2*wMH.piv[-10, 0, 20] + b3_1.effects[0|0]*stabRev.piv[1,2,3] /
U(alt3) = b0 + b1*coutH.piv[-100 , 0 , 100] + b2*wMH.piv[-10, 0, 20] + b3_1.effects[0|0]*stabRev.piv[1,2,3] $

Error: A pivot reference attribute has been specified with effects coding. The two are not compatible.

So far, I have tried this. Is this a correct way to circumvent my problem?

Design
; alts = alt1, alt2, alt3
; rows = 8
; eff = (mnl,d)
; model:
U(alt1) = b1*coutH.ref[100] + b2*wMH.ref[10] + b3*stabRev.ref[2] /
U(alt2) = b0 + b1*coutH.piv[-100 , 0 , 100] + b2*wMH.piv[-10, 0, 20] + b3_1.effects[0|0]*stabRev.piv[-1,0,1] /
U(alt3) = b0 + b1*coutH.piv[-100 , 0 , 100] + b2*wMH.piv[-10, 0, 20] + b3_1.effects[0|0]*stabRev.piv[-1,0,1] $




Best,

Damien
djourdain
 
Posts: 13
Joined: Mon Aug 19, 2013 7:55 pm

Re: Use pivot with effect-coded attribute

Postby Michiel Bliemer » Tue Apr 11, 2017 1:11 am

Apologies for the late reply, ew were all attending the International Choice Modelling Conference last week.

As the warning indicated, Ngene currently does not support effects coded variables in pivot designs. But there is a way to do this as follows:

Code: Select all
Design
;alts = alt1, alt2, alt3
;rows = 8
;eff = (mnl,d)
;alg = mfederov
;require:
alt1.stabRev = 2
;model:
U(alt1) = b1*coutHref[100] + b2*wMHref[10] + b3.effects[0|0]*stabRev[1,2,3] /
U(alt2) = b0 + b1*coutH[0,100,200](2-3,2-3,2-3) + b2*wMH[0,10,20](2-3,2-3,2-3) + b3.effects[0|0]*stabRev[1,2,3] /
U(alt3) = b0 + b1*coutH[0,100,200](2-3,2-3,2-3) + b2*wMH[0,10,20](2-3,2-3,2-3) + b3.effects[0|0]*stabRev[1,2,3] $


I have removed the references and pivots and replaced them with regular levels. Since I needed to add a constraint (;require command) I can only use the modified federov algorithm. In order to obtain some level of attribute level balance, I have added constraints on the number of times each level needs to appear in the design.

Outcome of this syntax is something like:


Choice situation alt1.couthref alt1.wmhref alt1.stabrev alt2.couth alt2.wmh alt2.stabrev alt3.couth alt3.wmh alt3.stabrev
1 100 10 2 100 20 3 200 0 2
2 100 10 2 200 20 2 0 0 3
3 100 10 2 200 0 3 0 20 1
4 100 10 2 0 0 2 200 10 3
5 100 10 2 0 10 2 100 0 1
6 100 10 2 100 20 3 0 10 1
7 100 10 2 200 0 1 100 20 2
8 100 10 2 0 10 3 200 20 1

You can manually create the pivot design by using the reference value, which results in

Choice situation alt1.couthref alt1.wmhref alt1.stabrev alt2.couth alt2.wmh alt2.stabrev alt3.couth alt3.wmh alt3.stabrev
1 100 10 2 0 10 1 100 -10 0
2 100 10 2 100 10 0 -100 -10 1
3 100 10 2 100 -10 1 -100 10 -1
4 100 10 2 -100 -10 0 100 0 1
5 100 10 2 -100 0 0 0 -10 -1
6 100 10 2 0 10 1 -100 0 -1
7 100 10 2 100 -10 -1 0 10 0
8 100 10 2 -100 0 1 100 10 -1
Michiel Bliemer
 
Posts: 470
Joined: Tue Mar 31, 2009 4:13 pm

Re: Use pivot with effect-coded attribute (and follow-up)

Postby djourdain » Wed May 10, 2017 9:14 pm

Dear Michiel,

My turn to apologize for late reply, I had switched to another project and I am now back on this one.
Thank you for the nice explanations. It is now working properly.

In fact, I am developing something a bit more complex, and I have 7 attributes (5 continuous all with three levels and 2 effect coded variables (one with three levels, one with two levels).
I am running the design search without any prior (using eff=(mnl, d)) as I would like to conduct a first short survey to be able to get some priors and run again a ngene but with some priors.

So far, I have decided to use rows = 12, but this is highly arbitrary. Is there any rule that can guide my choice of the the number of rows given the design I am trying to achieve?


(I have attached the design below)



Design
; alts = alt1, alt2, alt3
; rows = 12
; eff = (mnl, d)
; alg = mfederov
; require:
alt1.Fert=0 , alt1.tech=0

;model:
U(alt1) = b0 + b1*revRef[100] + b2*labourRef[100] + b3*labour2Ref[100] + b4*cashRef[100] + b5*storeRef[100] + b6.effects[0|0]*Fert[-1, 0, 1] + b7.effects[0]*tech[0, 1]/

U(alt2) = b1 * rev[80, 100, 150](3-4,3-4,3-4) + b2 * labour[80, 100, 150](3-4,3-4,3-4) + b3*labour2[80, 100, 150](3-4,3-4,3-4) + b4*cash[80,100, 150](3-4,3-4,3-4)
+ b5*store[80, 100, 150](3-4,3-4,3-4)
+ b6.effects[0|0]*Fert[-1,0,1] + b7.effects[0]*tech[0, 1] /

U(alt3) = b1 * rev[80, 100, 150](3-4,3-4,3-4) + b2 * labour[80, 100, 150](3-4,3-4,3-4) + b3*labour2[80, 100, 150](3-4,3-4,3-4) + b4*cash[80,100, 150](3-4,3-4,3-4)
+ b5*store[80, 100, 150](3-4,3-4,3-4)
+ b6.effects[0|0]*Fert[-1,0,1] + b7.effects[0]*tech[0, 1] $
djourdain
 
Posts: 13
Joined: Mon Aug 19, 2013 7:55 pm

Re: Use pivot with effect-coded attribute

Postby Michiel Bliemer » Wed May 10, 2017 10:29 pm

There is a minimum number of rows you need. If you specify a too low number in Ngene, Ngene will create an error message, so you will always be safe.

The minimum number of rows is equal to (# estimation parameters) / (#alternatives - 1).

If I count correctly, you are estimating in total 9 coefficients with 3 alternatives, hence 9 / (3-1) = 4.5, which means that you need at minimum 5 rows. Therefore 12 is enough.

You usually do not want to use the bare minimum number of rows, but rather go a little about it to have enough variation in your dataset. It is not necessary to have many rows like 50 or 100, I think in your case 12 is reasonable. It does not hurt going higher, so you could also do 18 or 24, but then you may want to block it as you do not want to show 24 questions to a single respondent.
Michiel Bliemer
 
Posts: 470
Joined: Tue Mar 31, 2009 4:13 pm

Re: Use pivot with effect-coded attribute

Postby djourdain » Thu May 11, 2017 11:16 am

Thank you for your help. Damien
djourdain
 
Posts: 13
Joined: Mon Aug 19, 2013 7:55 pm


Return to Stated choice experimental design

Who is online

Users browsing this forum: No registered users and 1 guest