Whether a numerical or categorical variable is preferred depends on the study objectives (e.g., do you want to compute elasticities), on the expected influence of the variable (how nonlinear is the effect), and how you would like to report the results.
Using age as a categorical variable has the following disadvantages:
* it increases the number of parameters, especially when interacting age with other attributes
* computing and interpreting elasticities becomes somewhat more difficult
* presenting respondents with an age range (e.g. 18-39) may introduce noise if the respondent would make different choices for ages 20 and 30; it would be unknown which age the respondent had in mind when making the choice
Using age as a numerical variable has the following disadvantages:
* it cannot easily account for highly nonlinear effects (e.g., drug choice high for 30 year old, drug choice low for 50 year old, drug choice high for 70 year old) although you can use nonlinear transformations of a numerical variable
* in forecasting you would get different drug choice shares for each age (18, 19, 20, ..., 39) instead of simply reporting them for a limited number of age categories
If you want to interact age with the attributes then you likely want to include age as a numerical variable as I have done in the syntax below. You can also interact comor with the attributes. Maybe not all interaction effects are of interest so you could choose which ones to include.
- Code: Select all
Design
;alts=drug,nodrug
;rows=72
;eff=(mnl,d)
;block=6
;cond:
if(drug.rega=4, drug.costa=[750,1500]),
if(drug.recura=50, nodrug.recurb=[56,62])
;model:
U(drug) = age[-0.02] * agea[20,30,40,50,60,70] ? scenario effect, describes impact of age on choice for drug
+ comor[-0.2] * comora[0,1] ? scenario effect, describes effect of comor on choice for drug
+ reg[0.3] * rega[3,4] ? main effect
+ recur[-0.1] * recura[36,42,50] ? main effect
+ mild[-0.05] * milda[1,12,37] ? main effect
+ perm[-0.1] * perma[1,10,14] ? main effect
+ fatal[-0.2] * fatala[0,1,3] ? main effect
+ cost[-0.0001] * costa[750,1500,6000] ? main effect
+ reg_age[0] * rega * agea ? interaction effect, describes impact of age on the importance of attribute reg in the choice for drug
+ recur_age[0] * recura * agea ? interaction effect, describes impact of age on the importance of attribute recur in the choice for drug
+ mild_age[0] * milda * agea ? interaction effect, describes impact of age on the importance of attribute mild in the choice for drug
+ perm_age[0] * perma * agea ? interaction effect, describes impact of age on the importance of attribute perm in the choice for drug
+ fatal_age[0] * fatala * agea ? interaction effect, describes impact of age on the importance of attribute fatal in the choice for drug
+ cost_age[0] * costa * agea ? interaction effect, describes impact of age on the importance of attribute cost in the choice for drug
+ reg_comor[0] * rega * comora ? interaction effect, describes impact of comor on the importance of attribute reg in the choice for drug
+ recur_comor[0] * recura * comora ? interaction effect, describes impact of comor on the importance of attribute recur in the choice for drug
+ mild_comor[0] * milda * comora ? interaction effect, describes impact of comor on the importance of attribute mild in the choice for drug
+ perm_comor[0] * perma * comora ? interaction effect, describes impact of comor on the importance of attribute perm in the choice for drug
+ fatal_comor[0] * fatala * comora ? interaction effect, describes impact of comor on the importance of attribute fatal in the choice for drug
+ cost_comor[0] * costa * comora ? interaction effect, describes impact of comor on the importance of attribute cost in the choice for drug
/
U(nodrug) = ascb[-0.3] ? alternative-specific constant
+ recur * recurb[50,56,62] ? main effect
$
If you are not interested in interaction effects or elasticities and you want to report results by age category, then you could include age as a categorical variable, see example below.
- Code: Select all
Design
;alts=drug,nodrug
;rows=72
;eff=(mnl,d)
;block=6
;cond:
if(drug.rega=4, drug.costa=[750,1500]),
if(drug.recura=50, nodrug.recurb=[56,62])
;model:
U(drug) = age.dummy[-0.4|-0.8] * agea[1,2,0] ? 0 = 18-39 (base), 1 = 40-59, 2 = 60+
+ comor[-0.2] * comora[0,1]
+ reg[0.3] * rega[3,4]
+ recur[-0.1] * recura[36,42,50]
+ mild[-0.05] * milda[1,12,37]
+ perm[-0.1] * perma[1,10,14]
+ fatal[-0.2] * fatala[0,1,3]
+ cost[-0.0001] * costa[750,1500,6000]
/
U(nodrug) = ascb[-0.3]
+ recur * recurb[50,56,62]
$
Please make sure that you choose appropriate priors, preferably from a pilot study. With your current priors, the choice share for drug is on average 40% over all choice tasks, so the majority is expected to select no drug. If that is not what you would expect then you need to update your priors.
Michiel