How to make constrained designs with covariates?

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

How to make constrained designs with covariates?

Postby ecd921 » Fri Nov 16, 2018 1:16 am

Hello,

I am trying to desing a labeled choice experiment that takes into consideration the country of origin. I would like to do this because for certain countries I have only some levels of the attributes for certain alternatives.

So, I have a model that has some constrains in its design, which runs fine. However, when I tried to include also the covariate (country) then it can not find the constrains. It shows the following error: "An attribute, 'lambleg.igp', specified in the ';cond' property could not be found".


I think it is because I should specify differently the constrains, but checking in the manual I could not find an example on how to do it when the model includes the covariates. Could you please let me know how could I manage this? Can I also specify different constrains for each model?

Thank you!

Here is the code:

Design
; alts(Finland) = lambleg, lambchops, goat, beef, none
; alts(France) = lambleg, lambchops, goat, beef, none
; alts(Italy) = lambleg, lambchops, goat, beef, none
; alts(Greece) = lambleg, lambchops, goat, beef, none
; alts(Spain) = lambleg, lambchops, goat, beef, none
; alts(Uk) = lambleg, lambchops, goat, beef, none
; alts(Turkey) = lambleg, lambchops, goat, beef, none
; rows = 12
; eff = F1(mnl, d)
; fisher (F1) = des1(Finland[0.143],France[0.143],Italy[0.143],Greece[0.143],Spain[0.143],Uk[0.143],Turkey[0.142]))

; con
; cond:
if (lambleg.origin=1, lambleg.igp=0),
if (lambchops.origin=1, lambchops.igp=0),
if (goat.origin=1, goat.igp=0),
if (beef.origin=1, beef.igp=0)

; model(Finland):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[1]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[1]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[1]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(France):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[2]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[2]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[2]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(Italy):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[3]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[3]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[3]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(Greece):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[4]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[4]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[4]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(Spain):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[5]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[5]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[5]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(Uk):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[6]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[6]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[6]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

; model(Turkey):
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0]+
b20*country.covar[7]*igp/
U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[7]*igp/
U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge+
b20*country.covar[7]*igp/
U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge/
U(none) = b19

$
ecd921
 
Posts: 2
Joined: Thu Nov 15, 2018 7:23 pm

Re: How to make constrained designs with covariates?

Postby Michiel Bliemer » Fri Dec 07, 2018 9:16 am

Apologies for the late reply.

Constraints and the fisher command are incompatible, but in this case I believe there is no need to include country as a covariate because you are asking for a homogeneous design and there is no difference in priors across countries.

My suggestion would be the following:

1. Create a design for a single country using the syntax below. Maybe consider increasing the number of rows and blocking the design in order to introduce more variation in your data, eg setting ;rows = 24 and ;block = 2.

2. If different countries have slightly different levels (eg difference prices) then simply manually change the levels for that country by replacing the lowest level for the country that you designed for with the lowest level of another country, etc. This way you keep consistency as much as possible across countries in your design (which is why you were doing a homogeneous design in the first place I assume).

3. Once you have collected the data, you include country as a covariate that you can interact with any attribute in your design (in alternatives lambleg, lambchops, goat, and beef) and estimate the model including these interaction effects. You WILL be able to estimate this model since all attributes vary across your design while country also varies across different respondents.

Michiel

Code: Select all
Design
;alts = lambleg, lambchops, goat, beef, none
;rows = 12
;eff = (mnl, d)
;con
;cond:
if(lambleg.origin=1, lambleg.igp=0),
if(lambchops.origin=1, lambchops.igp=0),
if(goat.origin=1, goat.igp=0),
if(beef.origin=1, beef.igp=0)

;model:
U(lambleg) = b1 +
b2[-0.0001] * llprice[4.84, 6.46, 8.07] +
b3.dummy*slaugh[1,0] +
b4.dummy[-0.0001|0.0001]*origin[1,2,0] +
b5.dummy[0.0001]*igp[1,0] +
b6*igp.dummy[1]*origin+
b7.dummy*feed[1,0] +
b8.dummy*lowcarb[1,0] +
b9.dummy*org[1,0] +
b10.dummy*fat[1,0] +
b11.dummy*prot[1,0] +
b12.dummy*pronti[1,0] +
b13.dummy[0.0001]*rouge[1,0] /

U(lambchops) = b14 +
b15[-0.0001] * lcprice[5.59,7.45,9.32] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge /

U(goat) = b16 +
b17[-0.0001] * lgprice[6.04,8.06,10.07] +
b3.dummy*slaugh +
b4.dummy*origin +
b5.dummy*igp +
b6*igp.dummy[1]*origin+
b7.dummy*feed +
b8.dummy*lowcarb +
b9.dummy*org +
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge /

U(beef) = b18[-0.0001] * lbprice[7.23,9.64,12.06] +
b3.dummy*slaugh+
b4.dummy*origin+
b5.dummy*igp+
b6*igp.dummy[1]*origin+
b7.dummy*feed+
b8.dummy*lowcarb +
b9.dummy*org+
b10.dummy*fat +
b11.dummy*prot +
b12.dummy*pronti +
b13.dummy*rouge /

U(none) = b19

$
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 39 guests

cron