Condition using a factor

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Condition using a factor

Postby anna_123 » Tue Jun 11, 2019 11:58 pm

Hi,

I am working on a design in which attribute levels should be realistic for the respondents. The condition I used before is just that travel times are higher when walking compared to cycling. However, what I would like to do is:

bike.time_bike*2.5 <= walk.time_walk

Is a condition like that possible and how?

Best regards,
Anna
anna_123
 
Posts: 5
Joined: Tue Nov 13, 2018 9:06 pm

Re: Condition using a factor

Postby Michiel Bliemer » Wed Jun 12, 2019 12:09 pm

The ;require and ;reject constraints do not recognise multiplications or divisions, but you could use the ;cond constraints. For example:

Code: Select all
design
;alts = walk, bike
;rows = 12
;eff = (mnl,d)
;cond:
if(bike.bike_time = 10, walk.walk_time = [25,35,45,55,65,75]),
if(bike.bike_time = 15, walk.walk_time = [45,55,65,75]),
if(bike.bike_time = 20, walk.walk_time = [55,65,75]),
if(bike.bike_time = 25, walk.walk_time = [65,75]),
if(bike.bike_time = 30, walk.walk_time = 75)
;model:
U(walk) = b0 + b1 * walk_time[15,25,35,45,55,65,75] /
U(bike) = b2 * bike_time[5,10,15,20,25,30]
$


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


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 32 guests