Multiple Interaction Terms for WTP & Thank You

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Multiple Interaction Terms for WTP & Thank You

Postby isaacwu5 » Tue Apr 18, 2023 10:34 pm

Hi all, thank you for all who have posted and replied. I've been able to incorporate a lot from studying your contributions.
I am running a WTP experiment for farmed salmon products with the following attributes:

Production Method (RAS)
    0 - farmed with Ocean Net-Pen
    1 - farmed with Recirculating Aquaculture System
Byproduct Management (BYP)
    1 - byproducts from this farm were not captured
    2 - byproducts from this farm were captured and sent to a waste treatment facility
    3 - byproducts from this farm were captured and repurposed as a natural fuel, food, or fertilizer
Stocking Density (DEN)
    25 kg/m3
    50 kg/m3
    85 kg/m3
% Non-Fish Ingredients in Feed (FED)
    20%
    50%
    80%
Days from Harvest to Store (DAY)
    1
    3
    5
    7
    9
U.S. Production (USP)
    0 - not farmed in the U.S.
    1 - farmed in the U.S.
Price per pound of the salmon in USD (PRIC)
    $9.99
    $12.99
    $15.99
    $18.99
    $21.99

As you can tell from the code below, I expect many of these attributes to be non-linear. I also want to incorporate some two-way interactions:

Code: Select all
Design
;alts = alt1*, alt2*, NONE
;rows = 512
;block = 128
;eff = (mnl,d)

;cond:
if(alt1.RAS = 0,   alt1.BYP = [1]),
if(alt1.RAS = 1,   alt1.BYP = [2,3]),

if(alt2.RAS = 0,   alt2.BYP = [1]),
if(alt2.RAS = 1,   alt2.BYP = [2,3])

;model:
U(alt1) =
        + b2.dummy[0]                            * RAS[0, 1]
        + b3.effects[0.001|0.002]            * BYP[2, 3, 1]
        + b4.effects[-0.001|-0.002]         * DEN[50, 85, 25]
        + b5.effects[0.001|0.002]            * FED[50, 80, 20]
        + b6.effects[-0.001|-0.002|-0.003|-0.004]  * DAY[3, 5, 7, 9, 1]
        + b7.dummy[0]                        * USP[0, 1]
        + b8[-0.0001]                          * PRIC[9, 12, 15, 18, 21]
        + i1[0.01]  * RAS.dummy[1]  * USP.dummy[1]
        + i2[0.01]  * RAS.dummy[1]  * DEN.dummy[50]
        + i3[0.01]  * RAS.dummy[1]  * DEN.dummy[85]
        + i4[0.01]  * RAS.dummy[1]  * FED.dummy[50]
        + i5[0.01]  * RAS.dummy[1]  * FED.dummy[80]
        + i6[0.01]  * USP.dummy[1]  * DEN.dummy[50]
        + i7[0.01]  * USP.dummy[1]  * DEN.dummy[85]
        + i8[0.01]  * USP.dummy[1]  * BYP.dummy[2]
        + i9[0.01]  * USP.dummy[1]  * BYP.dummy[3]
        + i10[0.01] * DEN.dummy[50] * BYP.dummy[2]
        + i11[0.01] * DEN.dummy[50] * BYP.dummy[3]
        + i12[0.01] * DEN.dummy[85] * BYP.dummy[2]
        + i13[0.01] * DEN.dummy[85] * BYP.dummy[3]       
        /
U(alt2) = b2.dummy*RAS + b3*BYP + b4*DEN + b5*FED + b6*DAY +
b7.dummy *USP + b8*PRIC + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13
$



Qs
    1. I get the error message: "Error: The model has an alternative specified with more than one constant. The constants are: i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13." The code runs when I only include i1. How do I include multiple interaction terms?

    2. I have tried to introduce some price constraints. For example, including more non-fish ingredients / lower stocking densities makes it more expensive, but nGene finds a hard time working with the constraints. Any way around this?

    3. I believe US Produced and RAS should be more expensive. How do I express this in the code?

    4. Is there anything else I can do to improve the design?
isaacwu5
 
Posts: 5
Joined: Tue Apr 11, 2023 9:05 pm

Re: Multiple Interaction Terms for WTP & Thank You

Postby Michiel Bliemer » Wed Apr 19, 2023 5:36 pm

1. You need to add the same interactions also in alt2, see script below where I have a single interaction effect as an example.

2. Since you are using a huge number of rows, you should not use the default swapping algorithm since the dominance constraints are extremely strong. Instead, switch to the modified Federov algorithm, see script below. The mfederov algorithm uses reject constraints. Note that your constraints create perfect correlations between RAS level 0 and BYP level 1, so you cannot estimate the model. You will likely need to merge RAS and BYP into a single variable, see script below. I also added some constraints as examples.

3. See constraints in the script below.

4. You need to add a constant for alt1 and alt2, so I added b1. Further, I suggest that you dummy code price at this stage since you are using uninformative near-zero priors, which tends to create choice tasks with mostly extreme attribute level comparisons ($9 versus $21) because of efficiency. Of course you can still estimate price linearly later on.

Code: Select all
Design
;alts = alt1*, alt2*, NONE
;rows = 512
;block = 128
;eff = (mnl,d)
;alg = mfederov
;reject:
? high non-fish ingredients cannot have low price levels
alt1.FED = 80 and alt1.PRIC < 15,
alt2.FED = 80 and alt2.PRIC < 15,
? low non-fish ingredients cannot have high price levels
?alt1.FED = 20 and alt1.PRIC > 15,
?alt2.FED = 20 and alt2.PRIC > 15,
? US-produced cannot have low price levels
alt1.USP = 1 and alt1.PRIC < 15,
alt2.USP = 1 and alt2.PRIC < 15,
? non-US produced cannot have high price levels
alt1.USP = 0 and alt1.PRIC > 15,
alt2.USP = 0 and alt2.PRIC > 15

;model:
U(alt1) = b1[0]                                                              ? alternative-specific constant (relative to none)
        + b3.effects[0.001|0.002]                 * RASBYP[2, 3, 1]          ? 1 = farmed with ocean net-pen and byproducts not captured (base),
                                                                             ? 2 = farmed with recirculating aquaculture system and byproducts captured and sent to waste treatment facility,
                                                                             ? 3 = farmed with recirculating aquaculture system and byproducts captured and repurposed
        + b4.effects[-0.001|-0.002]               * DEN[50, 85, 25]          ? density in kg/m3
        + b5.effects[0.001|0.002]                 * FED[50, 80, 20]          ? percentage non-fish ingredients
        + b6.effects[-0.001|-0.002|-0.003|-0.004] * DAY[3, 5, 7, 9, 1]       ? days for harvest to store
        + b7.dummy[0]                             * USP[0, 1]                ? 1 = farmed in the US (base), 0 = not farmed in the US
        + b8.dummy[-0.001|-0.002|-0.003|-0.004]   * PRIC[12, 15, 18, 21, 9]  ? price in USD per pound of salmon
        + i1[0.01]                                * RASBYP.dummy[1]  * USP.dummy[1]
        /
U(alt2) = b1
        + b3                                      * RASBYP
        + b4                                      * DEN
        + b5                                      * FED
        + b6                                      * DAY
        + b7                                      * USP
        + b8                                      * PRIC
        + i1                                      * RASBYP.dummy[1]  * USP.dummy[1]
$


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

Re: Multiple Interaction Terms for WTP & Thank You

Postby isaacwu5 » Thu Apr 20, 2023 3:40 am

Michiel,

Thank you for your reply. I have reworked the code to the following according to your notes. nGene could only produce one design with an undefined D-error. Do you know why this is happening? Do you have any further suggestions?

Code: Select all
Design
;alts = alt1*, alt2*, NONE
;rows = 512
;block = 128
;eff = (mnl,d)
;alg = mfederov
;reject:
alt1.FED = 80 and alt1.PRIC < 15,
alt2.FED = 80 and alt2.PRIC < 15,
alt1.DEN = 25 and alt1.PRIC < 15,
alt2.DEN = 25 and alt2.PRIC < 15,
alt1.RASBYP = 1 and alt1.PRIC < 15,
alt2.RASBYP = 1 and alt2.PRIC < 15

;model:
U(alt1) = b1[0]                                                                      + b3.effects[0.001|0.002]                 * RASBYP[2, 3, 1]                                                                                                                                                                            + b4.effects[-0.001|-0.002]               * DEN[50, 85, 25]                  + b5.effects[0.001|0.002]                 * FED[50, 80, 20]                  + b6.effects[-0.001|-0.002|-0.003|-0.004] * DAY[3, 5, 7, 9, 1]               + b7.dummy[0]                             * USP[0, 1]                        + b8.dummy[-0.001|-0.002|-0.003|-0.004]   * PRIC[12, 15, 18, 21, 9]          + i1[0.01]                                * RASBYP.dummy[1]  * USP.dummy[1]
        + i2[0.01]                                * RASBYP.dummy[2]  * DEN.dummy[50]
        + i3[0.01]                                * RASBYP.dummy[2]  * DEN.dummy[85]
        + i4[0.01]                                * RASBYP.dummy[3]  * DEN.dummy[50]
        + i5[0.01]                                * RASBYP.dummy[3]  * DEN.dummy[85]
        + i6[0.01]                                * RASBYP.dummy[2]  * FED.dummy[50]
        + i7[0.01]                                * RASBYP.dummy[2]  * FED.dummy[80]
        + i8[0.01]                                * USP.dummy[1]  * DEN.dummy[50]
        + i9[0.01]                                * USP.dummy[1]  * DEN.dummy[85]
        + i10[0.01]                               * USP.dummy[1]  * RASBYP.dummy[2]
        + i11[0.01]                               * USP.dummy[1]  * RASBYP.dummy[2]
        /
U(alt2) = b1
        + b3                                      * RASBYP
        + b4                                      * DEN
        + b5                                      * FED
        + b6                                      * DAY
        + b7                                      * USP
        + b8                                      * PRIC
        + i1                                      * RASBYP.dummy[1]  * USP.dummy[1]
        + i2                                * RASBYP.dummy[2]  * DEN.dummy[50]
        + i3                                * RASBYP.dummy[2]  * DEN.dummy[85]
        + i4                                * RASBYP.dummy[3]  * DEN.dummy[50]
        + i5                                * RASBYP.dummy[3]  * DEN.dummy[85]
        + i6                                * RASBYP.dummy[2]  * FED.dummy[50]
        + i7                                * RASBYP.dummy[2]  * FED.dummy[80]
        + i8                                * USP.dummy[1]  * DEN.dummy[50]
        + i9                                * USP.dummy[1]  * DEN.dummy[85]
        + i10                               * USP.dummy[1]  * RASBYP.dummy[2]
        + i11                               * USP.dummy[1]  * RASBYP.dummy[2]
$
isaacwu5
 
Posts: 5
Joined: Tue Apr 11, 2023 9:05 pm

Re: Multiple Interaction Terms for WTP & Thank You

Postby Michiel Bliemer » Thu Apr 20, 2023 8:46 am

It has to do with your interactions, an Undefined D-error means that one or more parameters in your model cannot be estimated. For example, you have twice the same interaction USP.dummy[1] * RASBYP.dummy[2]. You cannot add all interactions as your model will be overspecified, so I suggest you add your interactions one by one and make sure that your model parameters are identifiable. Also, you should not define variable DEN with effects coding and then refer to dummy coded variable DEN.dummy. Why not simply dummy code all coefficients?

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

Re: Multiple Interaction Terms for WTP & Thank You

Postby isaacwu5 » Tue Apr 25, 2023 10:16 pm

Thank you, Michiel, does nGene check if the choice matrix is full rank?

Also, I want to organize the choice sets into blocks of 4. Can I do this even though I'm not doing an orthogonal design?

Isaac
isaacwu5
 
Posts: 5
Joined: Tue Apr 11, 2023 9:05 pm

Re: Multiple Interaction Terms for WTP & Thank You

Postby Michiel Bliemer » Wed Apr 26, 2023 8:19 am

If a parameter is not identifiable, then the covariance matrix will not be of full rank and as a result the D-error will be infinite. So if you would be adding too many interaction effects Ngene will automatically show you a D-error of Undefined or extremely large. A finite D-error indicates that you can estimate all specified parameters.

With orthogonal designs, blocking is performed by creating an orthogonal blocking column, and as a result attribute level balance is guaranteed within each block. With efficient designs, such an orthogonal blocking column does not exist and instead Ngene searches for a near-orthogonal blocking column whereby correlation with other design columns is minimised, and as a result attribute balance is usually quite good within each block but not perfect. If you are not satisfied with the blocking that Ngene performs, you can always manually inspect and change the blocking manually, which has no impact on design efficiency.

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

Re: Multiple Interaction Terms for WTP & Thank You

Postby isaacwu5 » Fri Sep 22, 2023 4:37 am

Michiel,

As a refresher, I'm doing WTP for attributes of farmed salmon.

Here is part of my code. I've turned BYP into a binary variable, recycled or not, with the restriction that Open net pen byproducts can never be recycled.:

Code: Select all
Design
;alts = alt1*, alt2*, NONE
;rows = 80
;block = 16
;eff = (mnl,d)
;alg = mfederov
;reject:
alt1.DEN = 25 and alt1.RAS = 1 and alt1.PRIC < 15,
alt2.DEN = 25 and alt1.RAS = 1 and alt2.PRIC < 15,
alt1.RAS = 0 and alt1.BYP = 1,
alt2.RAS = 0 and alt2.BYP = 1

;model:
U(alt1) = b1[0]                                                                     
        + b2.dummy[0]                             * RAS[0, 1]
        + b3.dummy[0.001]                         * BYP[0, 1]
        + b4.dummy[0|0]                             * DEN[50, 85, 25]
        + b5.dummy[0.001|0.002]                   * OMG[2400, 3000, 1800]
        + b6.dummy[-0.001|-0.002|-0.003|-0.004]   * DAY[3, 5, 7, 9, 1]
        + b7.dummy[0.001]                             * USP[0, 1]
        + b8[-0.001]                              * PRIC[9, 12, 15, 18, 21]
        + i1[0.01]                                * RAS.dummy[1]  * USP.dummy[1]
        + i2[0.01]                                * RAS.dummy[1]  * DEN.dummy[50]
        + i3[0.01]                                * RAS.dummy[1]  * DEN.dummy[85]
        + i4[0.01]                                * RAS.dummy[1]  * DAY.dummy[3]
        + i5[0.01]                                * RAS.dummy[1]  * DAY.dummy[5]
        + i6[0.01]                                * RAS.dummy[1]  * DAY.dummy[7]
        + i7[0.01]                                * RAS.dummy[1]  * DAY.dummy[9]
        + i8[0.01]                                * DEN.dummy[50] * BYP.dummy[1]
        + i9[0.01]                                * DEN.dummy[85] * BYP.dummy[1]
        + i10[0.01]                               * USP.dummy[1]  * DAY.dummy[3]
        + i11[0.01]                               * USP.dummy[1]  * DAY.dummy[5]
        + i12[0.01]                               * USP.dummy[1]  * DAY.dummy[7]
        + i13[0.01]                               * USP.dummy[1]  * DAY.dummy[9]
        + i14[0.01]                               * USP.dummy[1]  * DEN.dummy[50]
        + i15[0.01]                               * USP.dummy[1]  * DEN.dummy[85]
       + i18[0.01]                               * USP.dummy[1]  * OMG.dummy[2400]       
       + i19[0.01]                               * USP.dummy[1]  * OMG.dummy[3000]       
        + i20[0.01]                               * USP.dummy[1]  * BYP.dummy[1]
        + i21[0.01]                               * DEN.dummy[50] * DAY.dummy[3]
        + i22[0.01]                               * DEN.dummy[50] * DAY.dummy[5]
        + i23[0.01]                               * DEN.dummy[50] * DAY.dummy[7]
        + i24[0.01]                               * DEN.dummy[50] * DAY.dummy[9]
        + i25[0.01]                               * DEN.dummy[85] * DAY.dummy[3]
        + i26[0.01]                               * DEN.dummy[85] * DAY.dummy[5]
        + i27[0.01]                               * DEN.dummy[85] * DAY.dummy[7]
        + i28[0.01]                               * DEN.dummy[85] * DAY.dummy[9]
        + i29[0.01]                               * DEN.dummy[50] * OMG.dummy[2400]
        + i30[0.01]                               * DEN.dummy[50] * OMG.dummy[3000]
        + i31[0.01]                               * DEN.dummy[85] * OMG.dummy[2400]
        + i32[0.01]                               * DEN.dummy[85] * OMG.dummy[3000]
        + i33[0.01]                               * BYP.dummy[1]  * OMG.dummy[2400]
        + i34[0.01]                               * BYP.dummy[1]  * OMG.dummy[3000]
        + i35[0.01]                               * BYP.dummy[1]  * DAY.dummy[3]
        + i36[0.01]                               * BYP.dummy[1]  * DAY.dummy[5]
        + i37[0.01]                               * BYP.dummy[1]  * DAY.dummy[7]
        + i38[0.01]                               * BYP.dummy[1]  * DAY.dummy[9]
        + i39[0.01]                               * OMG.dummy[2400] * DAY.dummy[3]
        + i40[0.01]                               * OMG.dummy[2400] * DAY.dummy[5]
        + i41[0.01]                               * OMG.dummy[2400] * DAY.dummy[7]
        + i42[0.01]                               * OMG.dummy[2400] * DAY.dummy[9]
        + i43[0.01]                               * OMG.dummy[3000] * DAY.dummy[3]
        + i44[0.01]                               * OMG.dummy[3000] * DAY.dummy[5]
        + i45[0.01]                               * OMG.dummy[3000] * DAY.dummy[7]
        + i46[0.01]                               * OMG.dummy[3000] * DAY.dummy[9]
        + i47[0.01]                * USP.dummy[1] * RAS.dummy[1]  * DAY.dummy[3]
        + i48[0.01]                * USP.dummy[1] * RAS.dummy[1]  * DAY.dummy[5]
        + i49[0.01]                * USP.dummy[1] * RAS.dummy[1]  * DAY.dummy[7]
        + i50[0.01]                * USP.dummy[1] * RAS.dummy[1]  * DAY.dummy[9]


Questions:
1) Above, you suggested that I estimate price as a dummy variable so that the model does not use the extremes. If I am using mfederov, is there still risk that will happen. When I run the code as is, I don't see a huge problem with this. Are there other risks that I am taking on by estimating price linearly?

2) If I am doing a WTP study, should I still be using mnl, d?

3) How do I know what non-zero prior to use with my interaction term. For example, utility should go down with days, so do I need to adjust the priors for interaction terms i47 to i50?

Best,
Isaac
isaacwu5
 
Posts: 5
Joined: Tue Apr 11, 2023 9:05 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 8 guests