Page 1 of 1

Condition using a factor

PostPosted: Tue Jun 11, 2019 11:58 pm
by anna_123
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

Re: Condition using a factor

PostPosted: Wed Jun 12, 2019 12:09 pm
by Michiel Bliemer
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