Hi everyone. I would need help in creating a formula to populate a random value of 1 or 0 based on a percentage value assigned per group.
Suppose my data looks something like this. I need to populate the third column with either 1 or 0 on whether that person is part of the sample or not.
The basis of sample selection is based on a lookup table similar to below. Per region I have a probability for selection.
So for instance 2% of people in Region A would have a value of 1.
98% of people in Region A would have a value of 0.
1% of people in Region B would have a value of 1.
99% of people in Region B would have a value of 0.
And so on....
Would appreciate any help as I am stuck as of the moment with this.
Thanks a lot!
Suppose my data looks something like this. I need to populate the third column with either 1 or 0 on whether that person is part of the sample or not.
PersonID | Region | Selection Value (1 or 0) |
1 | A | |
2 | B | |
3 | B | |
4 | C | |
5 | A |
The basis of sample selection is based on a lookup table similar to below. Per region I have a probability for selection.
So for instance 2% of people in Region A would have a value of 1.
98% of people in Region A would have a value of 0.
1% of people in Region B would have a value of 1.
99% of people in Region B would have a value of 0.
And so on....
Region | Percentage to Select (1) | Percentage not to Select (0) |
A | 2% | 98% |
B | 1% | 99% |
C | 8% | 92% |
Would appreciate any help as I am stuck as of the moment with this.
Thanks a lot!