ifferent attribute levels for attributes with generic para

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

ifferent attribute levels for attributes with generic para

Postby JMeyerhoff » Wed Jun 01, 2011 12:49 am

Hi,
As I understood from the topic „Use of generic or alternative specific parameters” in this forum it is possible to have different attribute levels for attributes that have a generic parameter. But does this also work when I want to use Bayesian priors?
The model I want to estimate has six alternatives and in all alternatives the attribute water quality (WQ) is present. However, in one alternative - U(SB) - water quality (should have) has one level less because in the present situation the quality for that part of the river is higher than in the other parts. The code I used (see below) always returns an error message. Thus I assume that I do a mistake or try to do something that is not possible?

Another question I have is related to dummy or effect coded attributes concerning the warning the NGENE manual gives on page 124 in the new manual (“Care should be taken when using dummy or effects codes in generating designs however …”). Is there any way to determine whether this is a problem for my model or not?

Code: Select all
? Bayesian efficient design with non-random parameters
design
;alts = HB, UH, OH, SS, ML, SB, SQ
;rows = 14
;bdraws = gauss(4)
;eff = (mnl,s,mean)
;model:
U(HB) = b1[0.7] + b7.effects[(u,0.1,0.5)|(u,0.3,0.8)|(u,0.5,1.1)] * WQ[1,2,3,0] + b8[(u,-0.3,0.0)] * price[5,15,25,50]  /
U(UH) = b2[0.8] + b7 * WQ                                                                  + b8 * price  /
U(OH) = b3[0.6] + b7 * WQ                                                                  + b8 * price  /
U(SS)  = b4[0.5] + b7 * WQ                                                                   + b8 * price  /
U(ML) = b5[0.7] + b7 * WQ                                                                   + b8 * price  /
U(SB)  = b6[0.9] + b7.effects[(u,0.1,0.5)|(u,0.3,0.8)] * WQ1[1,2,0]       + b8 * price                           
$


Thanks a lot for any hints,

Jürgen
JMeyerhoff
 
Posts: 6
Joined: Fri Apr 24, 2009 5:26 pm

Re: ifferent attribute levels for attributes with generic para

Postby Michiel Bliemer » Wed Jun 01, 2011 9:28 pm

Dear Jürgen,

It is no problem using Bayesian priors.

Yes, it is possible to use different attribute levels corresponding to a generic parameter IN CASE OF A LINEAR RELATIONSHIP. You just have to give the attribute a different name (e.g., A1 and A2) while giving the generic parameter the same name (e.g., b1).
For example,

Code: Select all
;model:
U(alt1) = b1[1] * A1[1,2,3] + ... /
U(alt2) = b1     * A2[1,4]


HOWEVER, I case there is a NONLINEAR RELATIONSHIP, such as in the case of effects or dummy coded variables, the levels should be the same, and particularly also the number of levels should be the same. For example, in your code b7 has 3 dummies for the first alternatives, and only 2 dummies for the SB alternative. Therefore, b7 is not generic in that sense and Ngene returns an error message.

This can be rather easily fixed, see the code below. I keep b7 generic over all parameters, but I REQUIRE as a condition that in alternative SB attribute WQ should be smaller than 3, using the require command. Alternatively, you could use the REJECT command by rejecting SB.WQ = 3. The require and reject commands should be used in conjunction with the Modified Federov algorithm. This lets go of attribute level balance, but you did not have that in your case anyway due to your choice of 14 rows.

Code: Select all
design
;alts = HB, UH, OH, SS, ML, SB, SQ
;rows = 14
;bdraws = gauss(4)
;alg = mfederov
;require:
SB.WQ < 3
;eff = (mnl,s,mean)
;model:
U(HB) = b1[0.7] + b7.effects[(u,0.1,0.5)|(u,0.3,0.8)|(u,0.5,1.1)] * WQ[1,2,3,0] + b8[(u,-0.3,0.0)] * price[5,15,25,50]  /
U(UH) = b2[0.8] + b7 * WQ                                                                  + b8 * price  /
U(OH) = b3[0.6] + b7 * WQ                                                                  + b8 * price  /
U(SS)  = b4[0.5] + b7 * WQ                                                                   + b8 * price  /
U(ML) = b5[0.7] + b7 * WQ                                                                   + b8 * price  /
U(SB)  = b6[0.9] + b7 * WQ                                                                   + b8 * price                           
$


If there is anything unclear, please let me know.
Michiel Bliemer
 
Posts: 1734
Joined: Tue Mar 31, 2009 4:13 pm

Re: ifferent attribute levels for attributes with generic para

Postby JMeyerhoff » Wed Jun 01, 2011 10:29 pm

Dear Michiel,
Thanks a lot - it works great :)
JMeyerhoff
 
Posts: 6
Joined: Fri Apr 24, 2009 5:26 pm

Re: ifferent attribute levels for attributes with generic para

Postby JMeyerhoff » Fri Jun 03, 2011 9:49 pm

Dear Michiel,

I have used the code above a couple of times now on two different computers and what happens is that after around 30 minutes (more than 20 000 iterations) NGENE quits and gives me an error message or the programme "freezes" and I have to close it via the task manager. However, when I use the code without ";alg = mfederov" no problems occur. Thus, is there anything I should change in any seetings? Both computers have at least 4 Gb memory so I think this should not be the problem. I use NGENE version 1.1.

Thanks again and best from Berlin,

Jürgen
JMeyerhoff
 
Posts: 6
Joined: Fri Apr 24, 2009 5:26 pm

Re: ifferent attribute levels for attributes with generic para

Postby Michiel Bliemer » Wed Jun 08, 2011 12:20 am

We are looking into it, stay tuned.
Michiel Bliemer
 
Posts: 1734
Joined: Tue Mar 31, 2009 4:13 pm

Re: ifferent attribute levels for attributes with generic para

Postby Andrew Collins » Wed Jun 08, 2011 4:57 pm

Jürgen

Try adding the extra parameter to the alg property below:

Code: Select all
;alg = mfederov(candidates=100)


The issue is that the candidate set for the modified federov algorithm is very large, and so with Bayesian priors the program takes a very long time to test even just the swaps for the first row of the design. A smaller candidate set should see many designs generated reasonably quickly. You could play around with the size, but 100 should do as a starting point.

Let me know how it goes.

Andrew
Andrew Collins
 
Posts: 78
Joined: Sat Mar 28, 2009 4:48 pm

Re: ifferent attribute levels for attributes with generic para

Postby JMeyerhoff » Thu Jun 09, 2011 1:20 am

Dear Andrew,

thanks - now it works :)

Jürgen
JMeyerhoff
 
Posts: 6
Joined: Fri Apr 24, 2009 5:26 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: TamsinD and 6 guests