Condition using a factor

This forum is for posts that specifically focus on the Windows desktop version of Ngene (i.e. all version 1.x releases).

Moderators: Andrew Collins, Michiel Bliemer, johnr

Post Reply
anna_123
Posts: 5
Joined: Tue Nov 13, 2018 9:06 pm

Condition using a factor

Post 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
Michiel Bliemer
Posts: 2057
Joined: Tue Mar 31, 2009 4:13 pm

Re: Condition using a factor

Post 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
Post Reply