restriting the attribute levels

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

restriting the attribute levels

Postby eija.pouta@luke.fi » Sat Nov 02, 2024 12:47 am

Hi,
I try to restrict the price levels in my design and to get balance of those levels left. For some reason I just cannot see the problem in my syntax, and I get the error message:
Error: Attribute 'price' has an incorrect number of attribute level frequencies specified: '6-12,6-12,6-12,6-12,0,0'
Can you recognize the issue?
Kind regards
Eija Pouta

Design
;alts = cellu, stone, wood, reed, none
;rows = 36
;eff = (mnl,d)
;alg=mfederov
;reject:
stone.ther < 1 ,
cellu.env < 1 ,
wood.env < 1 ,
reed.env < 1 ,
stone.env > 1

;model:
U(cellu) = b1[0.000] +
b2.dummy[0.15|0.04] * ther[1,2,0] +
b3.dummy[0.1] * dome[1,0] +
b4.dummy[0.1] * fire[1,0] +
b5.dummy[0.3|0.5] * env[1,2,0] +
b6[-0.005] * price[8,12,16,21,32,43](6-12,6-12,6-12,6-12,0,0)/

U(stone) = b7[0.2] +
b2.dummy * ther +
b3.dummy * dome +
b5.dummy * env +
b6 * price(6-12,6-12,6-12,6-12,0,0) /

U(wood) = b8[-0.001] +
b2.dummy * ther +
b3.dummy * dome +
b4.dummy * fire +
b5.dummy * env +
b6 * price (6-12,6-12,6-12,6-12,0,0)/

U(reed) = b9[-0.3] +
b2.dummy * ther +
b3.dummy * dome +
b4.dummy * fire +
b5.dummy * env +
b6 * price (0,0,6-12,6-12,6-12,6-12)

$
Error: Attribute 'price' has an incorrect number of attribute level frequencies specified: '6-12,6-12,6-12,6-12,0,0'
eija.pouta@luke.fi
 
Posts: 4
Joined: Wed Jun 12, 2024 9:11 pm

Re: restriting the attribute levels

Postby Michiel Bliemer » Sat Nov 02, 2024 7:21 am

Attributes with the same name need to have the same levels and restrictions. Also, you cannot use attribute level constraints (...) without specifying the attributes [...]. So the solution is simple, you can use price1 and price2, see below, whereby you can omit the levels that should not occur.

Code: Select all
Design
;alts = cellu, stone, wood, reed, none
;rows = 36
;eff = (mnl,d)
;alg=mfederov
;reject:
stone.ther < 1 ,
cellu.env < 1 ,
wood.env < 1 ,
reed.env < 1 ,
stone.env > 1

;model:
U(cellu) = b1[0.000] +
b2.dummy[0.15|0.04] * ther[1,2,0] +
b3.dummy[0.1] * dome[1,0] +
b4.dummy[0.1] * fire[1,0] +
b5.dummy[0.3|0.5] * env[1,2,0] +
b6[-0.005] * price1[8,12,16,21](6-12,6-12,6-12,6-12)/

U(stone) = b7[0.2] +
b2.dummy * ther +
b3.dummy * dome +
b5.dummy * env +
b6 * price1 /

U(wood) = b8[-0.001] +
b2.dummy * ther +
b3.dummy * dome +
b4.dummy * fire +
b5.dummy * env +
b6 * price1 /

U(reed) = b9[-0.3] +
b2.dummy * ther +
b3.dummy * dome +
b4.dummy * fire +
b5.dummy * env +
b6 * price2[16,21,32,43](6-12,6-12,6-12,6-12)

$


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

Re: restriting the attribute levels

Postby eija.pouta@luke.fi » Sun Nov 03, 2024 12:45 am

Many thanks for you quick reply!
Kind regards
Eija
eija.pouta@luke.fi
 
Posts: 4
Joined: Wed Jun 12, 2024 9:11 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: Yuchenj and 11 guests