Interactions with continuous variables

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Interactions with continuous variables

Postby jaein.seo » Sat Dec 09, 2017 5:29 am

Hi,

I am posting my queries regarding an efficient design with interactions. 7 attributes will be included with 3 levels each, except one attribute with 4 levels, as follow.

Att 1: 10, 40, 70 (continuous)
Att 2: 20, 60, 100 (continuous)
Att 3: unimpaired, mild, moderate, extreme (dummy)
Att 4: 0, 5, 10 (dummy)
Att 5: 0, 5, 10 (dummy)
Att 6: 0, 2, 4 (dummy)
Att 7: none, moderate, severe (dummy)

I'd like to include att 1, att 2, and att 3 in the interaction, resulting in two-way interactions. Please review the syntax below and advise. It does not run due to some errors I don't know how to fix. I do have some specific questions as well.

* Question 1: can I use random priors denoted by [(n, 0.0, 0.05)] in this design since the interaction term priors should probably not be directional?
* Question 2: could you clarify that I don't need i[(n,0.0, 0.05)]*sleep*impair[0] and i[(n,0.0, 0.05)]*awake[0] ?
* Question 3: are these priors specified appropriate? I saw a reply regarding usage of priors from another posting in this forum that priors can be used to calculate the average contribution of an attribute to utility. Does it pose a dominance issue or something?

Code: Select all
Design
;alts=trtA, trtB
;rows=24
;block=2
;bdraws=halton(200)
;eff=(mnl, d, mean)
;alg=swap(stop=total(600mins))

;model:

U(trtA)=b1[0.1]*sleep[70,40,10] +
        b2[0.1]*awake[100,60,20] +
        b3.dummy[0.3|0.2|0.1]*impair[3,2,1,0] +
        b4.dummy[0.2|0.1]*dizzy[2,1,0] +
        b5.dummy[0.2|0.1]*abnor[2,1,0] +
        b6.dummy[0.2|0.1]*fall[2,1,0] +
        b7.dummy[0.2|0.1]*depend[2,1,0] +
       i1[(n,0.0, 0.05)]*sleep*awake +
       i2[(n,0.0, 0.05)]*sleep*impair[1] +
       i3[(n,0.0, 0.05)]*sleep*impair[2] +
       i4[(n,0.0, 0.05)]*sleep*impair[3] +
       i5[(n,0.0, 0.05)]*awake*impair[1] +
       i6[(n,0.0, 0.05)]*awake*impair[2] +
       i7[(n,0.0, 0.05)]*awake*impair[3] /

U(trtB)=b1*sleep +
        b2*awake +
        b3*impair +
        b4*dizzy +
        b5*abnor +
        b6*fall +
        b7*depend +
       i1[(n,0.0, 0.05)]*sleep*awake +
       i2[(n,0.0, 0.05)]*sleep*impair[1] +
       i3[(n,0.0, 0.05)]*sleep*impair[2] +
       i4[(n,0.0, 0.05)]*sleep*impair[3] +
       i5[(n,0.0, 0.05)]*awake*impair[1] +
       i6[(n,0.0, 0.05)]*awake*impair[2] +
       i7[(n,0.0, 0.05)]*awake*impair[3] $


Thank you,
Jaein
jaein.seo
 
Posts: 9
Joined: Sat Nov 04, 2017 12:08 am

Re: Interactions with continuous variables

Postby Michiel Bliemer » Sat Dec 09, 2017 9:15 am

I identified a few issues with your syntax that will also answer your questions. The syntax below will work, but I have made several changes:

1) I changed the syntax impair[1] to impair.dummy[1], etc., in order tell Ngene that you are referring to level 1 of this attribute, otherwise you will get an error message.

2) I have changed many of your priors because they were way too large. Setting a prior of 0.1 for a variable that has levels 100,60,20 is not appropriate, since this would mean that this attribute alone will contribute on average 0.1*60 = 6 utility units. That is huge. A DIFFERENCE of 1 in utility between two alternatives is already fairly large. So please be very careful setting priors, if you are unsure it is best to set them to zero or set them conservatively (close to zero). Preferably you set them based on a pilot study.

3) Yes setting (n,0,0.5) as a Bayesian prior would be fine to indicate that you do not know the sign of the parameter, but also here note that draws from a normal distribution can be large (since it is unbounded) and your variable sleep*awake is a very large value, therefore require a very small prior. I set them to zero just to be sure, but you can add a normally distributed Bayesian prior if you like with an appropriately small standard deviation.

4) Many of your interactions will be zero, therefore in your 24 rows there will only be a few choice tasks for which there will actually be a trade-off. This means that you will need more rows in your design. I have doubled the number of rows (and blocks). To answer your question, you can indeed leave out interactions with the reference levels since these are always zero and hence cannot be estimated.

Good luck,
Michiel


Code: Select all
    Design
    ;alts=trtA, trtB
    ;rows=48
    ;block=4
    ;bdraws=halton(200)
    ;eff=(mnl, d)
    ;alg=swap(stop=total(600mins))

    ;model:

    U(trtA)=b1[0.01]*sleep[70,40,10] +
            b2[0.001]*awake[100,60,20] +
            b3.dummy[0.3|0.2|0.1]*impair[3,2,1,0] +
            b4.dummy[0.2|0.1]*dizzy[2,1,0] +
            b5.dummy[0.2|0.1]*abnor[2,1,0] +
            b6.dummy[0.2|0.1]*fall[2,1,0] +
            b7.dummy[0.2|0.1]*depend[2,1,0] +
           i1[0]*sleep*awake +
           i2[0]*sleep*impair.dummy[1] +
           i3[0]*sleep*impair.dummy[2] +
           i4[0]*sleep*impair.dummy[3] +
           i5[0]*awake*impair.dummy[1] +
           i6[0]*awake*impair.dummy[2] +
           i7[0]*awake*impair.dummy[3] /

    U(trtB)=b1*sleep +
            b2*awake +
            b3*impair +
            b4*dizzy +
            b5*abnor +
            b6*fall +
            b7*depend +
           i1*sleep*awake +
           i2*sleep*impair.dummy[1] +
           i3*sleep*impair.dummy[2] +
           i4*sleep*impair.dummy[3] +
           i5*awake*impair.dummy[1] +
           ?i6*awake*impair.dummy[2] +
           i7*awake*impair.dummy[3] $
Michiel Bliemer
 
Posts: 1705
Joined: Tue Mar 31, 2009 4:13 pm

Re: Interactions with continuous variables

Postby jaein.seo » Sat Dec 16, 2017 2:40 am

Thank you, Michiel, for your thorough response. I'm learning more about the priors as I develop the syntax for this study, thanks to your feedback.
I need to change the priors again based on the literature review.
- reducing the time to 'sleep' by 1 min is worth about 2 * reducing time 'awake' by 1 min
- each min of these avoided is worth about 1/100 * improving impairment by 1 level (I believe that this is too large to account for in the design and unlikely to be correct.)

I'd like to
- reflect these evidence above
- have 'sleep' and 'awake' consistent
- avoid having dominating attributes
- use Bayesian distribution to capture uncertainty about the value (to avoid to use exact values for high relative value priors) and encode orthogonality with directional priors

I would greatly appreciate your feedback on the following codes.

Code: Select all
? use of interactions in the model

Design
    ;alts   = trtA*, trtB*
    ;rows   = 24
    ;block  = 2
    ;bdraws = halton(200)
    ;rseed  = 667
    ;eff    = (mnl, d, mean)
    ;alg    = swap(stop=total(600mins))

    ;model:
    U(trtA)=b1[(n,0.01,0.001)]            * sleep[60,45,30]       +
            b2[(n,0.008,0.001)           * awake[100,75,50]      +
            b3.dummy[(n,0.1,0.001)]           * impair[2,1,0]         +
              b4.dummy[0.2|0.1]                   * dizzy[2,1,0]          +
              b5.dummy[0.2|0.1]                   * abnor[2,1,0]          +
             b6.dummy[0.2|0.1]                   * fall[2,1,0]           +
              b7.dummy[0.2|0.1]                   * depend[2,1,0]         +
              i1[(n, 0.0, 0.0005)]                    * sleep*awake           +
             i2[(n, 0.0, 0.0005)]                    * sleep*impair.dummy[1] +
       i3[(n, 0.0, 0.0005)]                  * sleep*impair.dummy[2] +
              i4[(n, 0.0, 0.0005)]                   * awake*impair.dummy[1] +
       i5[(n, 0.0, 0.0005)]              * awake*impair.dummy[2] /

    U(trtB)=b1*sleep  +
            b2*awake  +
            b3*impair +
              b4*dizzy  +
            b5*abnor  +
              b6*fall   +
              b7*depend +
              i1*sleep  * awake           +
              i2*sleep  * impair.dummy[1] +
       i3*sleep  * impair.dummy[2] +
       i4*awake  * impair.dummy[1] +
              i5*awake  * impair.dummy[2] $
jaein.seo
 
Posts: 9
Joined: Sat Nov 04, 2017 12:08 am

Re: Interactions with continuous variables

Postby Michiel Bliemer » Thu Dec 28, 2017 8:22 am

Apologies for late response, I was on holidays.

Syntax looks fine to me, although your Bayesian priors have a very narrow distribution; (n,0.1,0.001) is essentially 0.1, the standard deviation of 0.001 is too small to account for any uncertainty. Maybe consider a standard deviation of 50% of the prior value, e.g. (n,0.1,0.05).

Further, it is best to add:

;bdraws = gauss(3)
Michiel Bliemer
 
Posts: 1705
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron