Same attribute names but different levels

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Same attribute names but different levels

Postby xiaoxiadong » Fri Feb 15, 2019 3:04 pm

Dear Ngene team,

I have an embarrassingly basic question and was hoping you could share some insight. Let's say I have three attributes for two alternatives. Attribute A has different levels across alternatives. When I ran the following script,

Design
;alts = alt1, alt2
;rows = all
;fact
;model:
U(alt1) = b1 + b2 * A[0,1,2] + b3 * B[0,1] /
U(alt2) = b2 * A[2,3] + b4 * C[2,4,6,8]
$

I got the error message:
[Error: Two identically named attributes do not have consistently specified levels: 'alt2.a', 'alt1.a']

I was under the impression that different utility functions may have attributes with identical names but different levels. According to page 48 in the manual,
“If the levels are different, then the attribute level values will need to be added. Note that
one can use the same attribute name in different utility functions as Ngene will treat them
separately (Ngene will refer to them in the output as ‘alt1.A’ and ‘alt2.A’, etc.).”

The code worked when I changed attribute A to a different name but I was wondering if there was a way for it to work without changing the attribute name.

Thank you in advance for your time and help!
xiaoxiadong
 
Posts: 3
Joined: Fri Feb 15, 2019 11:46 am

Re: Same attribute names but different levels

Postby Michiel Bliemer » Sat Feb 16, 2019 9:57 am

No it will only work if you give the attributes different names since the allowed levels are attached to the name. Note that giving attributes a different name does not make any difference to the model you are estimating since A[0,1,2] and A2[2,3] both have generic coefficient b2 and that is the relevant part.

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

Re: Same attribute names but different levels

Postby xiaoxiadong » Sat Feb 16, 2019 10:10 am

Thank you so much for the clarification! I really appreciate it!
xiaoxiadong
 
Posts: 3
Joined: Fri Feb 15, 2019 11:46 am


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 8 guests

cron