Page 1 of 1

Interaction effects

PostPosted: Thu Apr 22, 2021 11:42 pm
by suella_rodrigues
Professor,

I need your guidance on this.
I am trying to understand and implement interaction effects. In my first survey I had not used any interactions in my design. Here is the old code (homogenous bayesian efficient design with 2 products) and I will modify this with new priors, SD:
Code: Select all
Design
;alts(beef) = alt1, alt2, neither
;alts(milk) = alt1, alt2, neither

;rows = 18
;block = 3
;eff = beef(mnl,d,mean)+milk(mnl,d,mean)
;bdraws = sobol(1000)

;cond:
if(alt1.origin=alt2.origin, alt1.welfare<>alt2.welfare),
if(alt1.origin=0 and alt1.infectionlevel=0 and alt1.price=[0,1], alt2.welfare<alt1.welfare)

;con
; model(beef):
?origin #, infectionlevel#, price#, welfare
U(alt1)    = b2.effects[(n,0.1,0.3)|(n,0.3,0.5)]*origin[0,1,2] + b3[(n,-0.01,0.01)]*infectionlevel[0,10,20,30]    + b4.effects[(n,0.6,0.2)|(n,-0.7,0.6)]*price[0,1,2] + b5.effects[(n,0.9,0.3)|(n,1.02,0.5)]*welfare[0,1,2] /
U(alt2)    = b2*origin        + b3*infectionlevel + b4*price     +b5*welfare                     /
U(neither) = b6[0.8]

; model(milk):
?origin #, infectionlevel#, price#, welfare
U(alt1)    = b2.effects[(n,0.4,0.2)|(n,0.7,0.5)]*origin[0,1,2] + b3[(n,-0.04,0.01)]*infectionlevel[0,10,20,30]    + b4.effects[(n,0.6,0.2)|(n,-0.3,0.6)]*price[0,1,2] + b5.effects[(n,0.4,0.2)|(n,0.7,0.5)]*welfare[0,1,2] /
U(alt2)    = b2*origin        + b3*infectionlevel + b4*price     +b5*welfare                     /
U(neither) = b6[-1.8]

$


I am running the survey again but this time I want to add interaction effects in the deign itself. Particularly interaction between two attributes and their levels.
However, I am too uncertain.
What I am struggling with is the following:
I will get my priors from estimating an mnl and rpl model using interactions I hadn't designed for before i.e. The first full study had no interaction effects designed. What would be the impact of this?

The attributes for interaction are:
Welfare: High welfare, med welfare, low welfare (low welfare is the base level)
Infection level: inf0, inf10, inf20, inf30 (base level is inf0 indication 0(%) infection)

if I interact these, I get 6 new variables that I would need to add to the design! Is that correct?
highwel*inf0 (base)
highwel*inf10
highwel*inf20
highwel*inf30

medwel*inf0(base)
medwel*inf10
medwel*inf20
medwel*inf30

Problem with collinearity if I were to include these:
lowwel*inf0 (base)
lowwel*inf10
lowwel*inf20
lowwel*inf30

Thank you
Maria

Re: Interaction effects

PostPosted: Sat Apr 24, 2021 8:00 am
by Michiel Bliemer
In most cases you can estimate interaction effects in your model even if you did not include such effects when optimising for efficiency. So I think that you will be able to estimate all effects that you are interested in. The only case where this may not be possible is if there exists perfect correlation between the two attributes. The benefit of including interaction effects in the utility functions when designing your experiment is that it will guarantee that you can estimate the coefficients for these interaction effects and it considers these effects when maximising efficiency (minimising D-error).

In case of dummy coding, you would not include interactions with the base level because they will be zero and cannot be estimated. While the base level is not zero for effects coded variables, you cannot include all interactions because some of them will not be identifiable. I do not have much experience with effects coding, but I think that you may want to consider only making interactions with non-base levels. You also have to think about how to interpret these interaction effects.

Michiel

Re: Interaction effects

PostPosted: Tue May 04, 2021 12:37 am
by suella_rodrigues
Thank you professor.

I have attempted to code the interactions (see below) and I get a d-error of 3.02 (after running it for a while) which is worrying me. Do you see any obvious problems with my syntax?
Code: Select all
?consumer main

Design
;alts(beef) = alt1, alt2, neither
;alts(milk) = alt1, alt2, neither
;alts(wool) = alt1, alt2, neither

;rows = 18
;block = 3
;eff = beef(mnl,d,mean)+milk(mnl,d,mean)+wool(mnl,d,mean)
;bdraws = sobol(1000)

;cond:
if(alt1.origin=alt2.origin, alt1.welfare<>alt2.welfare),
if(alt1.origin=0 and alt1.infectionlevel=0 and alt1.price=[0,1], alt2.welfare<alt1.welfare)

;con
; model(beef):
?origin #, infectionlevel#, price#, welfare
U(alt1)    = b2.effects[(n,0.6,0.1)|(n,0.2,0.1)]*origin[0,1,2] + b3.effects[(n,-0.6,0.2)|(n,-1.04,0.2)|(n,-1.7,0.3)]*infectionlevel[10,20,30,0] + b4.effects[(n,0.8,0.1)|(n,0.2,0.1)]*price[0,1,2] + b5.effects[(n,0.8,0.2)|(n,0.6,0.2)]*welfare[0,1,2] +i1[-0.01]*welfare.effects[0]*infectionlevel.effects[10] +i2[0.1]*welfare.effects[0]*infectionlevel.effects[20]  +i3[0.1]*welfare.effects[0]*infectionlevel.effects[30]  +i4[-0.3]*welfare.effects[1]*infectionlevel.effects[10]  +i5[-0.3]*welfare.effects[1]*infectionlevel.effects[20]  +i6[0.1]*welfare.effects[1]*infectionlevel.effects[30] /
U(alt2)    = b2*origin        + b3*infectionlevel + b4*price     +b5*welfare                     /
U(neither) = b6[0.3]

; model(milk):
?origin #, infectionlevel#, price#, welfare
U(alt1)    = b2.effects[(n,0.6,0.1)|(n,0.4,0.1)]*origin[0,1,2] + b3.effects[(n,-0.7,0.2)|(n,-0.5,0.2)|(n,-1.2,0.2)]*infectionlevel[10,20,30,0] + b4.effects[(n,0.7,0.1)|(n,0.4,0.1)]*price[0,1,2] + b5.effects[(n,0.9,0.2)|(n,0.4,0.2)]*welfare[0,1,2] +i1[-0.04]*welfare.effects[0]*infectionlevel.effects[10] +i2[-0.2]*welfare.effects[0]*infectionlevel.effects[20]  +i3[-0.1]*welfare.effects[0]*infectionlevel.effects[30]  +i4[0.3]*welfare.effects[1]*infectionlevel.effects[10]  +i5[-0.6]*welfare.effects[1]*infectionlevel.effects[20]  +i6[0.1]*welfare.effects[1]*infectionlevel.effects[30] /
U(alt2)    = b2*origin        + b3*infectionlevel + b4*price     +b5*welfare                     /
U(neither) = b6[0.06]

; model(wool):
?origin #, infectionlevel#, price#, welfare
U(alt1)    = b2.effects[(n,0.5,0.1)|(n,0.2,0.1)]*origin[0,1,2] + b3.effects[(n,-0.5,0.1)|(n,-0.4,0.2)|(n,-1.0,0.2)]*infectionlevel[10,20,30,0] + b4.effects[(n,0.5,0.1)|(n,0.2,0.1)]*price[0,1,2] + b5.effects[(n,0.8,0.1)|(n,0.4,0.2)]*welfare[0,1,2] +i1[0.1]*welfare.effects[0]*infectionlevel.effects[10] +i2[-0.1]*welfare.effects[0]*infectionlevel.effects[20]  +i3[-0.1]*welfare.effects[0]*infectionlevel.effects[30]  +i4[0.03]*welfare.effects[1]*infectionlevel.effects[10]  +i5[-0.2]*welfare.effects[1]*infectionlevel.effects[20]  +i6[-0.1]*welfare.effects[1]*infectionlevel.effects[30] /

U(alt2)    = b2*origin        + b3*infectionlevel + b4*price     +b5*welfare                     /

U(neither) = b6[0.4]

$



1. The att infection level I have now effects coded it because in my model I treated this attribute as dummy.
2. Is it possible to have the main effects coded as I do and have the interactions dummy coded? If yes, why would I want that?
3. Initially I wanted to optimise for MNL and evaluate for RPL but this seems unnecessarily? complicated. In my study I want to present results of both mnl and rpl.
4. I haven't used Bayesian priors for the interaction variable. Should I be doing it?
5. The extra 6 columns for interactions in the design can essentially be ignored, am I right?

* I also checked and found no perfect corr between my attributes however I want to ensure I am able to estimate the coefficients for the interactions.

Thank you
Maria

Re: Interaction effects

PostPosted: Tue May 04, 2021 9:18 am
by Michiel Bliemer
I checked your D-error and there is no issue with it. It has a D-error of slightly over 1 for each of the three models (so they add up to being over 3 together), mainly due to interactions with effects coded variables (which are notoriously difficult to estimate and typically require large sample sizes to become statistically significant). You should be able to estimate all coefficients using these designs.

1. I do not understand what you mean; you use effects coding because you treat an attribute as a dummy? Maybe you are confusing terminology here. Categorical/qualitative variables can be effects coded OR dummy coded, they are two different coding schemes.

2. No, if you main effects are effects coded, then you can only refer to them in interactions as effects coded variables.

3. It is fine to just optimise for MNL

4. No you can leave them fixed. I often fix them to zero since it is difficult to guess these priors.

5. Yes you do not show these columns to respondents and can ignore them at the design stage, they are only used in model estimation.

Michiel

Re: Interaction effects

PostPosted: Tue May 04, 2021 7:27 pm
by suella_rodrigues
THANK YOU VERY MUCH PROFESSOR!

Maria

Re: Interaction effects

PostPosted: Wed May 12, 2021 9:58 am
by suella_rodrigues
Professor,

1. Do I need to include interactions i in the alt 2 as well?

2. So as a reminder, my priors come from a previous study code 1 above and the new study is a continuation code2. I want to be able to make comparisons between the two studies. Now, in the first study I effects coded my variables, can I now change it to dummy coding in the new study cod 2. What impact would this have? and why?

3. What about Bayesian averaging? Given I have 3 products ( a homogenous design) would you recommend 1. model with interaction and 2. model without interaction?

Thank you
Maria

Re: Interaction effects

PostPosted: Wed May 12, 2021 10:24 am
by Michiel Bliemer
1. In a labelled experiment, you will need to include the same interactions in all alternatives. In a labelled experiment, you can choose where you include interactions since they may be alternative-specific, so you may leave them out in some alternatives.

2. While the coefficients for dummy and effects coding are different, there is no difference in behaviour that they describe, and you can rewrite effects coding to dummy coding and the other way around. Optimising for effects coding will lead to slightly different designs than optimising for dummy coding because of the difference in coefficients and standard errors.

3. You could apply model averaging if you like. The benefit would be that you make the coefficients of the interactions less important than the coefficients of the main effects. If you consider a model with interactions then the estimation of main effects and interaction effects are considered equally important.

Michiel