Page 1 of 1

How do I assign probability to certain inputs?

Posted: Tue Jan 05, 2010 6:16 pm
by DDLin26
I have two variables of values 0 and 1, respectively.

I would like to make a new variable that takes in these two variables, and picks either 0 or 1 based on an assigned probability. Let's say I want the new variable to return a '0' 95% of the time, and to return '1' 5% of the time.

is this possible?

Posted: Wed Jan 06, 2010 11:30 am
by Administrator
I usually do something like this.

Random number = Random 0 1 ()

result = if then else ( Random number > .95 , 1 , 0 )