Running efficient designs with priors of 0

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Running efficient designs with priors of 0

Postby mham0997 » Mon Nov 30, 2020 12:28 pm

Hi there,

We have a design set up but without any priors established, as we do not know what these should be, nor do we understand priors in terms of direction. I understand to progress with the design we need to run it with priors so I was wondering can we assume they are 0 at this stage? How would the syntax/code look for this?

Thanks!
mham0997
 
Posts: 9
Joined: Wed Nov 04, 2020 4:23 pm

Re: Running efficient designs with priors of 0

Postby Michiel Bliemer » Tue Dec 01, 2020 12:08 pm

If no prior information is available, then it is common to set all priors to zero. In the Ngene syntax you use something like:

U(alt1) = b1[0] + b1[0] * cost[1,2,3] + b2.dummy[0|0] * comfort[1,2,3]

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

Re: Running efficient designs with priors of 0

Postby mham0997 » Wed Dec 02, 2020 3:45 am

Thanks so much Michiel!

I was wondering does each new attribute need to have a different prior? eg, for the syntax below I should be labelling the priors in the (alt2) row as b1, b2, b3, b4 still or since these correspond to different attributes as in (alta) row have I labelled these correctly? I seem to come up with a different d-error depending on the label of the priors

Design
;alts = alt1, alt2, alt3
;rows = 8
;eff = (mnl,d)
;block = 3, minmax, noimprov(10 secs)
;alg = mfederov(stop=total(200000 iterations))
;model:
U(alt1) = b1[0] + b1[0] * A[0,1] + b2[0] *B[0,1,2,3] +b3[0] *C[0,1,2,3] + b4[0]* D[0,1] + b5[0]* E[0,1] /
U(alt2) = b1[0] + b1[0] * A + b2[0] * B +b6[0] * F[0,1] + b7[0] * G[0,1] + b8[0] * H[0,1][/b]
$

Regards,
Melanie
mham0997
 
Posts: 9
Joined: Wed Nov 04, 2020 4:23 pm

Re: Running efficient designs with priors of 0

Postby Michiel Bliemer » Wed Dec 02, 2020 7:43 am

Your parameters should have the same variable name across alternatives if it is generic (e.g. in an unlabelled experiment), and they should have different names if they are alternative-specific (in a labelled experiment). So in your example you have specified generic parameters for attributes A and B and alternative-specific parameters for the other attributes. That is fine. You could also use alternative-specific parameters for attributes A and B if you believe that behavioural preferences for the same attribute differ across labelled alternatives (for example, travel time experienced in a car is different from travel time experienced in a train). Changing parameters from generic to alternative-specific leads to a different model with more parameters and hence a different D-error.

There is a mistake in your syntax caused by a mistake in my example, you used b1 twice in the same alternative. Corrected example syntax:

U(alt1) = b1[0] + b2[0] * cost[1,2,3] + b3.dummy[0|0] * comfort[1,2,3]

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

Re: Running efficient designs with priors of 0

Postby mham0997 » Thu Dec 03, 2020 4:25 pm

Thanks Michiel,

I noticed you have put [0] after the priors but am unclear what this means? also what is the difference with [0|0]? is this a dummy and when would a dummy be indicated over [0]?

Also, my understanding is that priors are essentially data on the mean and standard deviation? but our data is mostly categorical not continuous, in which case does this effect the priors? Is the dummy related to a categorical or continuous variable?

One more thing! I just need to understand determining the direction ( + or -) of the priors?

Sorry about all the questions!
Melanie
mham0997
 
Posts: 9
Joined: Wed Nov 04, 2020 4:23 pm

Re: Running efficient designs with priors of 0

Postby Michiel Bliemer » Thu Dec 03, 2020 5:45 pm

Hi Melanie,

I will need to refer you to the Ngene manual where you will find all the answers to your questions, but some quick answers:

1. You mentioned that you do not know the value of the priors, nor the sign, therefore you would want to set the priors to zero. Using [0] behind a parameter means setting the prior equal to zero.

2. If you have 3 levels for a dummy coded variables, you need to estimate 2 parameters and each parameter needs a prior. So using b1.dummy[0|0] * comfort[1,2,3] sets the priors for levels 1 and 2 to zero while level 3 is the reference level. If an attribute is categorial, you will need to use dummy or effects coding for that attribute. If the attribute is continuous you do not need to use dummy coding, e.g. b2[0] * cost[10,15,20] if the costs are $10, $15, or $20.

3. Priors are best guesses of the parameter values. The objective of the data collection is to estimate the parameters, but you can make your data collection more efficient if you provide some good guesses about the expected value. If you do not know the value, setting priors to zero is fine. If you have done a pilot study, you can use the parameter estimates as a prior, and the standard errors describe the unreliabilty about the prior that can be useful for Bayesian priors.

4. If you only know the direction of the priors, you can use a very small negative or positive value, e.g. -0.000001 or 0.000001 as prior. This means that the prior is essentially zero, but it would allow the automatic avoidance of dominant alternatives in Ngene.

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

Re: Running efficient designs with priors of 0

Postby mham0997 » Fri Dec 11, 2020 10:26 am

Hi Michiel,

Thanks so much for your help! I am slowly getting the hang of the code. However I was just wondering if you could tell me what you think of this code in regards to:

1. What variables would require .dummy prefix? I noticed that adding .dummy increases the D-error so I am not sure if I am adding it to the correct variables?
2. after the first prior b1[0] do I need to add +b2[0]? again I notice if I remove this the d-error is reduced.
3. I have tried to use blocks but this does not make a difference to the D-error, is this neccesary?
4. Once we have run the MNL design with priors set as [0] it appears we then run a Bayesian efficient design with random priors. How do we format the priors for the Bayesian design?

Design
;alts = alt1, alt2, alt3
;rows = 8
;eff = (mnl,d)
;alg = mfederov(stop=total(200000 iterations))
;model:
U(alt1) = b1[0] * LowerBackPain[0,1] + b2[0] *numberofCommorbidities[0,1,2,3] +b3[0] *Opioidchoice [0,1,2,3] + b4[0]* OpioidPainReduction[1,2] + b5[0]* OpioidAdverseEvents[7,4] /
U(alt2) = b1[0] * LowerBackPain + b2[0]* numberofCommorbidities + b6[0]* NSAID[0,1] + b7[0]* NSAIDPainReduction[1,3] + b8[0]* NSAIDAdverseEvents[4,2]
$

Regards,
Melanie
mham0997
 
Posts: 9
Joined: Wed Nov 04, 2020 4:23 pm

Re: Running efficient designs with priors of 0

Postby Michiel Bliemer » Fri Dec 11, 2020 1:19 pm

1. You need to dummy code all variables that do not have continuous levels, i.e. all categorical variables (e.g. low/medium/high, blue/yellow/red, etc). You do not have to use dummy coding for example for price/cost, distance, time, etc. Please refer to dummy coding in the literature. You should NOT look at D-error when deciding whether a variable needs to be dummy coded or not. You will likley need dummy coding for most of your variables.

2. Using b2 or b2[0] is the same and will not change your D-error. You need to specify the utility function that you want to estimate, you should NOT look at the D-error when specifying your model because your model specification reflects your study and choice behaviour that you are interested in analysing.

3. No blocks are not necessary, but having 8 rows is not enough, it will have too little variation in the data to estimate your coefficients. Given the number of parameters and the likely dummy coding you need, I would rather use something like 24 rows and then block in 3 blocks to give 8 choice tasks to a single respondent.

4. The format will be: b[(n,param,se)] where param is the parameter value you obtain from a pilot study, and se is the associated standard error. This provides a normally distributed Bayesian prior.

Given the questions asked, I suggest that you read a book on discrete choice modelling and experimental design, or take a 1-week course (I am involved in 2 courses per year, including the use of Ngene, but there are others offering courses on choice modelling as well). A good book to read would be:

Hensher, Rose and Greene (2015) Applied choice analysis. Second edition, Cambridge Univsity Press.

Another book that is available for free online, but does not discuss choice experiments, is:

Train (2009) Discrete choice methods with simulation. Second edition, Cambridge University Press.

Discrete choice modelling is not something that most people easily pick up, so it does require quite a bit of investment in time.

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


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 1 guest