Random occurrence generation in a List
Posted: October 21st, 2019, 9:39 am
Hi all,
I have a problem and would like your opinion:
I have a questionnaire with two sections: household characteristics and information from each resident.
Some sections contain information for all residents while others should be directed to residents drawn for particular age groups.
For example, suppose we have 14 residents in a household, distributed as follows:
Age group | Number of Residents
0 - 5 years | 2
6 - 15 years | 3
16 - 35 years | 4
36 - 60 years | 3
Over 60 | 2
From certain sections of the questionnaire, we would have to draw only one resident from each age group and this group of drawn residents would be persistent for all other sections.
At first, I thought of using the random function, but by default, the sequence of random numbers generated by repeated calls to random will always be the same.
What alternative would you have to solve this problem?
Note: if possible, could you indicate the respective codes to solve the problem?
Thanks in advance,
I have a problem and would like your opinion:
I have a questionnaire with two sections: household characteristics and information from each resident.
Some sections contain information for all residents while others should be directed to residents drawn for particular age groups.
For example, suppose we have 14 residents in a household, distributed as follows:
Age group | Number of Residents
0 - 5 years | 2
6 - 15 years | 3
16 - 35 years | 4
36 - 60 years | 3
Over 60 | 2
From certain sections of the questionnaire, we would have to draw only one resident from each age group and this group of drawn residents would be persistent for all other sections.
At first, I thought of using the random function, but by default, the sequence of random numbers generated by repeated calls to random will always be the same.
What alternative would you have to solve this problem?
Note: if possible, could you indicate the respective codes to solve the problem?
Thanks in advance,