Dummy coded scenario variables without main effects
Posted: Fri Feb 17, 2023 4:10 am
Dear Michiel,
I have a quick question on adding a dummy coded, scenario variable into my design without first including it as a main effect in the utility function in ngene. I can't find the answer in the manual, in this forum or in your slides.
Brief background
My experiment requires individuals to choose between two treatments, A or B, based on 3 attributes:
(1)[NHB] as a categorical variable with 4 levels;
(2)[CERT] as a categorical variable with 4 levels;
(3)[WAIT] as a continuous variable.
I have two scenario variables:
(4) [LIFE] as a continuous variable,
(5) [QOL] as a categorical variable with 4 levels.
I planned on interacting LIFE and QOL with two of the attributes (1-3) to include in the design as contextual effects. I did not plan to (and don't think I should) include LIFE and QOL as main effects - consistent with your advice.
Here is my code, I have indicated where I have issues with i5,i6 and i7 in ?comments? in the code chunk below.
Also, if I could check my choice task (row) calculation S = K/(J-1). As I have 1 ASC [1 parameter to estimate], 2 continuous variables [2 additional parameters], 3 categorical variables, each with 4 levels (as interactions) [3(4-1) = 9 additional parameters]. S= 12 parameters. So I am correct using 36 with 3 blocks to get have sufficient variation to calculate multiple catigorical variables? Thought as it's an efficient design I'm not sure I would have to stick to a multiple of 12 for ALB, but 12 choice tasks per respondent is probably manageable.
Also if you have any concerns about how I have estimated my priors (for the pilot study) please do indicate.
I also tried coding it as below, but that did not work either:
Thanks in advance for any advice - much appreciated!
I have a quick question on adding a dummy coded, scenario variable into my design without first including it as a main effect in the utility function in ngene. I can't find the answer in the manual, in this forum or in your slides.
Brief background
My experiment requires individuals to choose between two treatments, A or B, based on 3 attributes:
(1)[NHB] as a categorical variable with 4 levels;
(2)[CERT] as a categorical variable with 4 levels;
(3)[WAIT] as a continuous variable.
I have two scenario variables:
(4) [LIFE] as a continuous variable,
(5) [QOL] as a categorical variable with 4 levels.
I planned on interacting LIFE and QOL with two of the attributes (1-3) to include in the design as contextual effects. I did not plan to (and don't think I should) include LIFE and QOL as main effects - consistent with your advice.
Here is my code, I have indicated where I have issues with i5,i6 and i7 in ?comments? in the code chunk below.
Also, if I could check my choice task (row) calculation S = K/(J-1). As I have 1 ASC [1 parameter to estimate], 2 continuous variables [2 additional parameters], 3 categorical variables, each with 4 levels (as interactions) [3(4-1) = 9 additional parameters]. S= 12 parameters. So I am correct using 36 with 3 blocks to get have sufficient variation to calculate multiple catigorical variables? Thought as it's an efficient design I'm not sure I would have to stick to a multiple of 12 for ALB, but 12 choice tasks per respondent is probably manageable.
Also if you have any concerns about how I have estimated my priors (for the pilot study) please do indicate.
- Code: Select all
design
;alts = DrugA*, DrugB*
;rows = 36
;block= 3
;eff =(mnl,d)
;alg = mfederov
;reject:
DrugA.LIFE = 0.5 and DrugA.WAIT = 0.5,
DrugA.LIFE = 0.5 and DrugA.WAIT = 1,
DrugA.LIFE = 0.5 and DrugA.WAIT = 2,
DrugA.LIFE = 1 and DrugA.WAIT = 1,
DrugA.LIFE = 1 and DrugA.WAIT = 2,
DrugA.LIFE = 2 and DrugA.WAIT = 2,
DrugB.LIFE = 0.5 and DrugB.WAIT = 0.5,
DrugB.LIFE = 0.5 and DrugB.WAIT = 1,
DrugB.LIFE = 0.5 and DrugB.WAIT = 2,
DrugB.LIFE = 1 and DrugB.WAIT = 1,
DrugB.LIFE = 1 and DrugB.WAIT = 2,
DrugB.LIFE = 2 and DrugB.WAIT = 2
;require:
DrugA.LIFE = DrugB.LIFE,
DrugA.QOL = DrugB.QOL
;model:
U(DrugA) = c1
+ b1.dummy[0.0001|0.0002|0.0003] * NHB[1,2,3,0]
+ b2.dummy[0.0001|0.0002|0.0003] * CERT[1,2,3,0]
+ b3[-0.0001] * WAIT[0,0.5,1,2]
+ i4[0] * WAIT * LIFE[0.5,1,2,5] ?LIFE is simple to interact without being added as main effects as it is continuous
+ i5.[0] * WAIT * QOL.dummy[1] ?No matter how I code these, I get error messages
+ i6.[0] * WAIT * QOL.dummy[2] ?No matter how I code these, I get error messages
+ i7.[0] * WAIT * QOL.dummy[3] ?No matter how I code these, I get error messages
/
U(DrugB) = b1.dummy[0.0001|0.0002|0.0003] * NHB[1,2,3,0]
+ b2.dummy[0.0001|0.0002|0.0003] * CERT[1,2,3,0]
+ b3[-0.0001] * WAIT[0,0.5,1,2]
+ i4[0|0|0] * WAIT * LIFE[0.5,1,2,5]
+ i5.[0] * WAIT * QOL.dummy[1]
+ i6.[0] * WAIT * QOL.dummy[2]
+ i7.[0] * WAIT * QOL.dummy[3]
$
I also tried coding it as below, but that did not work either:
- Code: Select all
;model:
U(DrugA) = c1
+ b1.dummy[0.0001|0.0002|0.0003] * NHB[1,2,3,0]
+ b2.dummy[0.0001|0.0002|0.0003] * CERT[1,2,3,0]
+ b3[-0.0001] * WAIT[0,0.5,1,2]
+ i4[0] * WAIT * LIFE[0.5,1,2,5]
+ i5.dummy[0|0|0] * WAIT * QOL.dummy[1,2,3,0]
/
U(DrugB) = b1.dummy[0.0001|0.0002|0.0003] * NHB[1,2,3,0]
+ b2.dummy[0.0001|0.0002|0.0003] * CERT[1,2,3,0]
+ b3[-0.0001] * WAIT[0,0.5,1,2]
+ i4[0|0|0] * WAIT * LIFE[0.5,1,2,5]
+ i5.dummy[0|0|0] * WAIT * QOL[1,2,3,0]
$
Thanks in advance for any advice - much appreciated!