Same attribute names but different levels
Posted: 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!
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!