Hello,
I am struggling with this which should be seemingly simple.
How can I assign a random binary value to a percentage of identified cells?
I have a column that indicates which cells I want this binary value to be associated with. My problem is when trying to chose both a percentage and implementing a random element to it.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Suvey ID[/TD]
[TD]Season[/TD]
[TD]Score[/TD]
[TD]Random Binary[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Peak[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Peak[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Off Season[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Off Season[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Off Season[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Off Season[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Peak[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Within the random binary field I want to give 70% of those within the "Off Season" category a 1 and the remaining 30% a 0. For those in the "Peak Season" I would like to assign 30% a 1 and 70% a 0.
Any advice would be of great help!
Thank you,
Dan
I am struggling with this which should be seemingly simple.
How can I assign a random binary value to a percentage of identified cells?
I have a column that indicates which cells I want this binary value to be associated with. My problem is when trying to chose both a percentage and implementing a random element to it.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Suvey ID[/TD]
[TD]Season[/TD]
[TD]Score[/TD]
[TD]Random Binary[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Peak[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Peak[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Off Season[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Off Season[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Off Season[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Off Season[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Peak[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Within the random binary field I want to give 70% of those within the "Off Season" category a 1 and the remaining 30% a 0. For those in the "Peak Season" I would like to assign 30% a 1 and 70% a 0.
Any advice would be of great help!
Thank you,
Dan