Why do I have ! in my correlations

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Why do I have ! in my correlations

Postby NormaB » Wed Dec 08, 2021 9:38 pm

This is my syntax
design
;alts(mnl_model) = alt1*, alt2*
;alts(rppanel_model) = alt1*, alt2*
;rows = 36
;eff = mnl_model(mnl,d)
;block = 3
;model(mnl_model):
U(alt1)= b1*A[50,60,70] + b2*B[30,50,70] + b3*C[1] + b4*D[0,1,2] +b5*E[0.25,2,5,10]/
U(alt2) = b1*A2[60,70,80] + b2*B2[25,40,50] + b3*C2[1,3,5] + b4*D[0,1,2] +b5*E2[0.25]
;model(rppanel_model):
U(alt1)= b1*A[50,60,70] + b2*B[30,50,70] + b3*C[1] + b4*D[0,1,2] +b5*E[0.25,2,5,10]/
U(alt2) = b1*A2[60,70,80] + b2*B2[25,40,50] + b3*C2[1,3,5] + b4*D[0,1,2] +b5*E2[0.25]

$

I let Ngene run for over 12 hours then checked my correlations. They were as below. Why do I have ! instead of numbers?
Note - Attribute D is dummy coded

Correlations (Pearson Product Moment)
Attribute alt1.a alt1.b alt1.c alt1.d alt1.e alt2.a2 alt2.b2 alt2.c2 alt2.d alt2.e2 Block
alt1.a 1 0.083333 ! 0 0.312874 -1 -0.115897 0.333333 0 ! 0
alt1.b 0.083333 1 ! 0 -0.241557 -0.083333 -0.993399 -0.208333 0 ! 0
alt1.c ! ! ! ! ! ! ! ! ! ! !
alt1.d 0 0 ! 1 0.009202 0 -0.016557 0 -1 ! 0
alt1.e 0.312874 -0.241557 ! 0.009202 1 -0.312874 0.181001 -0.621148 -0.009202 ! -0.004601
alt2.a2 -1 -0.083333 ! 0 -0.312874 1 0.115897 -0.333333 0 ! 0
alt2.b2 -0.115897 -0.993399 ! -0.016557 0.181001 0.115897 1 0.24835 0.016557 ! 0
alt2.c2 0.333333 -0.208333 ! 0 -0.621148 -0.333333 0.24835 1 0 ! 0
alt2.d 0 0 ! -1 -0.009202 0 0.016557 0 1 ! 0
alt2.e2 ! ! ! ! ! ! ! ! ! ! !
Block 0 0 ! 0 -0.004601 0 0 0 0 ! 1
NormaB
 
Posts: 7
Joined: Fri Jul 23, 2021 9:16 pm

Re: Why do I have ! in my correlations

Postby Michiel Bliemer » Thu Dec 09, 2021 10:53 am

Correlations with a ! are not defined. For example, C only has a single value of 1, and E2 only has a single value of 0.25. Correlations are not defined for variables that are constant. In other words, correlations with constants are meaningless.

Note that your rppanel model does not have any random parameters, do this model is the same as the MNL model the way you have specified it. Otherwise, you need to use something like b1[n,0.3,0.2] for a normally distributed random parameter with a fixed prior of 0.3 for the mean and a fixed prior of 0.2 for the standard deviation. You would need to estimate these priors from a pilot study. In your case, you can remove the rppanel model because it is not meaningful without specifying random parameters.

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

Re: Why do I have ! in my correlations

Postby NormaB » Thu Dec 09, 2021 10:45 pm

Thank you Michiel, this is very helpful.

So I have revised the model as below because attribute D is dummy coded. But I get this error
Error: An attribute has the wrong number of levels for dummy or effects coding. 'd'
design
;alts(mnl_model) = alt1*, alt2*
;alts(rppanel_model) = alt1*, alt2*
;rows = 36
;eff = mnl_model(mnl,d)
;block = 3
;model(mnl_model):
U(alt1)= b1*A[50,60,70] + b2*B[30,50,70] + b3*C[1] + b4.dummy*D[0,1,2] +b5*E[0.25,2,5,10]/
U(alt2) = b1*A2[60,70,80] + b2*B2[25,40,50] + b3*C2[1,3,5] + b4.dummy*D[0,1,2] +b5*E2[0.25]
$

Also my intention is to have this as a labelled DCE. I cant seem to figure out (from the notes from the training) the difference in utility function between labelled and unlabelled DCE. Please clarify.

Kind regards
Norma

What am I doing wrong?
Also this is a labelled desig
NormaB
 
Posts: 7
Joined: Fri Jul 23, 2021 9:16 pm

Re: Why do I have ! in my correlations

Postby Michiel Bliemer » Fri Dec 10, 2021 8:38 am

With dummy coding, Ngene requires that you specify the priors so that you are aware that you are estimating multiple coefficients. If you want to use zero priors, then it becomes b4.dummy[0|0] * D[0,1,2]. Note that Ngene uses the last level as base level, in this case level 2 is the base level (with zero utility) and the utilities of levels 0 and 1 are estimated via the dummy coded parameters.

A labelled alternative has a label-specific constant, so you would need to add a constant to either alt1 or alt2, e.g. U(alt1) = b0 + ...
Also, labelled alternatives can have alternative-specific parameters, therefore you could use b11 for A in alt1 and b12 for A in alt2, but they can also be generic. Whether they are generic or alternative-specific depends on your specific study. Attributes can also have different levels for different labelled alternatives.

Example unlabelled alternatives (identical utility functions)

U(routeA)= b1 * time[10,20,30] + b2 * cost[1,2,3] /
U(routeB) = b1 * time + b2 * cost

Example labelled alternatives (different utility functions where bus has a constant and time has an alternative-specific coefficient)

U(bus) = b1 + b2 * time[20,30,40] + b3 * fare[1,2,3] /
U(train) = b4 * time[10,20,30] + b3 * fare

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

Re: Why do I have ! in my correlations

Postby NormaB » Fri Dec 10, 2021 9:23 am

Thank you, Michiel. This is of great help.
NormaB
 
Posts: 7
Joined: Fri Jul 23, 2021 9:16 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 5 guests