Page 1 of 1
Different levels with similar attributes

Posted:
Tue Apr 08, 2025 12:38 pm
by a.tran@sydney.edu.au
Hi Everyone,
My survey has two alternatives: A (with AI) and B (without AI). I have attribute Supporting Evidence (SE). For alternative A, the SE will have 3 levels: No supporting evidence, Observational studies, and RCT. For Alternative B, the SE will have "Not applicable". Another attribute is Cost to your clinics (COST). For alternative A, the COST has 3 levels: <$2000, $2000- $10000,>$10,000. For alternative B, the level will be $0.
Can anyone please share with me how to do different levels with the same attribute? Currently, I just left them out for alternative B and manually added "NA" for SE for alt B, and "$0" for COST for alt B. Any solutions so that we do not need to do it manually? Thank you so much.
Design
;alts = A, B
;rows = 72
;eff = (mnl,s)
;block = 6
;model:
U(A) = b1[-0.05]*FP[1, 10, 30] + b2[-0.05]*FN[1, 10, 15] + b3[0.05]*SE[1,2,3] + b4[0.05]*TS[1, 2, 3]+ b5[-0.05]*WL[1,2,3]+ b6[-0.05]*COST[1,2,3]/
U(B) = b1 *FP + b2 *FN + b4 *TS + b5 *WL $
Re: Different levels with similar attributes

Posted:
Wed Apr 09, 2025 11:48 am
by Michiel Bliemer
First of all, all categorical variables need to be dummy coded (or effects coded).
If a level of a dummy coded variable only appears in one alternative and not in any of the other alternatives, then it is embedded in the alternative-specific constant.
Further, your priors do not seem to come from a pilot study; setting them manually is not a good idea. For example, -0.05 is quite large for attributes FP and FN, which would dominate the choice. If no prior information is available, it is best to use (near) zero priors.
See code below.
- Code: Select all
Design
;alts = A, B
;rows = 72
;eff = (mnl,d)
;block = 6
;model:
U(A) = b1[-0.001] * FP[1,10,30]
+ b2[-0.001] * FN[1,10,15]
+ b3.dummy[0.01|0.02] * SE[2,3,1]
+ b4.dummy[0.01|0.02] * TS[2,3,1]
+ b5.dummy[-0.01|-0.02] * WL[2,3,1]
+ b6.dummy[-0.01|-0.02] * COST[2,3,1]
/
U(B) = b0 ? this constant will also capture $0 COST and "n/a" for SE
+ b1 * FP
+ b2 * FN
+ b4 * TS
+ b5 * WL
$
Further, using cost categories is not a good idea, because people will not know what "2000-10000" means; is it 5000? is it 8000? Different people will have a different number in mind. And >10,000, can this be 100,000? Also, if you assume categories then it will be difficult to calculate any willingness-to-pay. It would be best to make cost a numerical attribute as in the script below, which also allows capturing the cost coefficient for both alternatives without including it in the alternative-specific constant.
- Code: Select all
Design
;alts = A, B
;rows = 72
;eff = (mnl,d)
;block = 6
;model:
U(A) = b1[-0.001] * FP[1,10,30]
+ b2[-0.001] * FN[1,10,15]
+ b3.dummy[0.01|0.02] * SE[2,3,1]
+ b4.dummy[0.01|0.02] * TS[2,3,1]
+ b5.dummy[-0.01|-0.02] * WL[2,3,1]
+ b6[-0.000001] * COST[1000,2000,3000,5000,8000,10000,15000]
/
U(B) = b0 ? this constant will also capture "n/a" for SE
+ b1 * FP
+ b2 * FN
+ b4 * TS
+ b5 * WL
+ b6 * COST2[0]
$
I hope that these examples help.
Michiel
Re: Different levels with similar attributes

Posted:
Tue Apr 15, 2025 3:57 pm
by a.tran@sydney.edu.au
Thank you so much, Professor Bliemer. I appreciate your help very much.
Best wishes
Anh
Re: Different levels with similar attributes

Posted:
Tue Apr 15, 2025 4:35 pm
by a.tran@sydney.edu.au
Dear Professor Bliemer,
May I please have 2 more questions? Sorry if the questions are silly. I am very new to DCE, just a beginning learner.
1. Why in the SE or TS, you use [2,3,1] instead of [1,2,3] or [3,2,1]? I used either increasing or decreasing so I can decide whether the coefficient is + or -.
2. Could you please direct me to the documents where I could learn about constraints? I would like to have:
Shorter consultation time (TS) always goes with an increase in workload (WL)
Longer consultation time (TS) always goes with a decrease in workload (WL)
No change in consultation time (TS) always goes with minimal change in workload (WL) (no change).
So TS [1,2,3] for TS [ shorter, no change, longer ] -> the shorter the better, the coefficient will be negative
WL [1, 2,3] is [increase, no change, decrease] -> people prefer an increase in WL, the coefficient will be negative.
Could you please teach me how to do constraints? Thank you very much.
Re: Different levels with similar attributes

Posted:
Wed Apr 16, 2025 7:36 am
by Michiel Bliemer
1. The LAST level is the base/reference level for dummy coding. I usually use 0 or 1 as the base level, so I usually write [2,3,1] when dummy coding, but it is perfectly fine to write [1,2,3] and use level 3 as the base level. When you use uninformative priors with - or +, then the order does not matter, it simply looks at the value of the level itself. So b1.dummy[+] * X[1,2,3] states that larger levels are more preferred. So also in b1.dummy[+] * X[2,3,1] level 3 would be most preferred and level 1 least preferred. When you use informative priors, the order of the levels DOES matter because they have to match the priors. So b1.dummy[0.01|0.02] * X[2,3,1], whereby level 3 is the base/reference level and level 1 is least preferred and level 3 is most preferred, would be equivalent in describing behaviour as b1.dummy[-0.02|-0.01] * X[1,2,3], where again level 3 is most preferred and level 1 is least preferred.
2. Please refer to Chapter 6 in the Ngene manual, which explains how to use constraints:
[url]files.choice-metrics.com/NgeneManual.pdf[/url]
If you are using the default swapping algorithm, you could use something like:
;cond:
if(A.TS = 1, A.WL = [2,3]),
if(A.TS = 3, A.WL = [1,2]),
if(B.TS = 1, B.WL = [2,3]),
if(B.TS = 3, B.WL = [1,2])
Note that you need to be careful linking levels of two dummy coded attributes together, e.g. if(A.TS = 2, A.WL = 2), because this could cause perfect correlations between the attribute levels and result in multicollinearity and an unidentified model (i.e., a model that cannot be estimated). This could possibly occur no change in TS always goes with no change in WL. If such levels are linked, they need to be taken out of the dummy coding and put in a single variable as they always move together and you will need to consider model identifiability and carefully think about your utility functions. This is not something that I can easily help with because it is study specific and sometimes requires quite a bit of time. Ngene will tell you when a model is not identified because it will generate a design with an Undefined D-error, or not generate a design at all. That would be an indication that your constraints are too strict and you need to reformulate your utility function and/or constraints.
Michiel