Labelled design

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Labelled design

Postby Sameh » Wed Feb 05, 2025 9:17 am

Dear Dr. Michiel,

I would appreciate your guidance in improving this script. I believe there is an issue—specifically, with the definition of two attributes [cafeina, sabor].

To provide some context: this is a labelled design with seven labels (Coca-Cola, Fanta, Schweppes, Pepsi, Inca Kola, 7-Up), including a "none" option.

Regarding the required command: for alternatives 2, 3, 5, and 6, the attribute cafeina (which has two levels: sin cafeína and con cafeína) is fixed at sin cafeína. However, alternatives 1 and 4 can be either sin cafeína or con cafeína. The same logic applies to the sabor attribute: alt5.sabor is fixed to the original [5], while sabor are assigned specific levels for the other alternatives.

All the attributes are categorical except the price.

**************
Design
;alts = alt1* , alt2*, alt3*, alt4*, alt5*, alt6*, none
;rows = 42
;block = 3 , minsum
;eff = (mnl,d)
;require:
alt2.cafeina = 1,
alt3.cafeina = 1,
alt5.cafeina = 1,
alt6.cafeina = 1
alt5.sabor = 5
;model:
U(alt1) = b1 + b2.dummy[0] * Cafeina[1,2] + b3.dummy[0]* origen[1,2] + b4.dummy[0] * tipo[1,2] + b5.dummy[0|0] * sabor_cola[1,9,14] + b6* Price_cola[1, 1.15, 1.4, 1.6] (0-42, 2-12, 2-12, 2-12)/
U(alt2) = b7 + b2 * Cafeina + b3* origen + b4tipo + b8.dummy[0|0] * sabor_fan[2,11,13] + b9 Price_fan[0.85, 1, 1.1, 1.2](0-42, 2-12, 2-12, 2-12)/
U(alt3) = b10 + b2 * Cafeina + b3* origen + b4*tipo + b11.dummy[0|0] * sabor_shwep[1,3,11] + b12 * Price_shwep[0.9, 1, 1.15, 1.4](0-42, 2-12, 2-12, 2-12)/
U(alt4) = b13 + b2 * Cafeina + b3* origen + b4*tipo + b14.dummy[0|0] * sabor_pepsi[9,4,10] + b15 * Price_pepsi[1.05, 1.15, 1.35, 1.5](0-42, 2-12, 2-12, 2-12)/
U(alt5) = b16 +b2 * Cafeina + b3* origen + b4*tipo + b17 * sabor[5] + b20 * Price_inca[0.90, 1.05, 1.15, 1.30](0-42, 2-12, 2-12, 2-12)/
U(alt6) = b18+ b2 * Cafeina + b3* origen + b4*tipo + b19.dummy[0|0] * sabor_up[6,7,8] + b20 * Price_up[0.65, 0.85, 1, 1.15](0-42, 2-12, 2-12, 2-12)
$

I mean for example in alt 5, sabor (catego.var) has only one level, so how can I specify it in the script?
May I remove variables in each alternative with one level? but now I start to think about Zeros that I will obtain in the unspecified variable/alternative instead of the levels that has to be mentioned.
I don´t know if I well explained the issue that I have. Can you help me with this?
Greetings,
Sameh
 
Posts: 12
Joined: Wed Nov 03, 2021 6:26 pm
Location: Spain

Re: Labelled design

Postby Michiel Bliemer » Wed Feb 05, 2025 10:13 am

You need to remove the asterisk (*) in alts because this is for unlabelled alternatives, while your alternatives are labelled.
You need to add ;alg = mfederov as the require constraints only work with this algorithm.

There is no need to set alt5.sabor=5 because you can specify this attribute simply with a single level in the utility function, e.g. sabor_inca[5]. HOWEVER, you cannot estimate parameter b17 because you also have constant b16 and you cannot have two constants in the same utility function as this would result in an unidentifiable model. So you either need to remove this attribute, so that b17 will be absorbed into the constant b16, or level 5 should also appear in another alternative and you use a generic coefficient.

For example, you could use b5 across all alternatives, but you will need to make sure that there are no levels that are unique for one alternative, so sabor = 5 MUST also appear in another alternative.
;reject:
alt1.sabor <> 1 and alt1.sabor = <> 9 and alt1.sabor <> 14,
... etc
alt1.sabor <> 5,
... etc
;model:
U(alt1) = ... + b5.dummy[0|0|0|0|0|0|0|0|0|0|0|0|0] * sabor[1,2,3,4,5,6,7,8,9,10,11,12,13,14] + ...
U(alt2) = ... + b5 * sabor + ...
U(alt3) = ... + b5 * sabor + ...
U(alt4) = ... + b5 * sabor + ...
U(alt5) = ... + b5 * sabor + ...
U(alt6) = ... + b5 * sabor + ...

Michiel
Michiel Bliemer
 
Posts: 1918
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: Sameh and 2 guests