Page 1 of 1

How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 11th, 2022, 6:37 pm
by sham
Hi Family,
I am dealing with household roster(all household members).
Now there is another Questionnaire level which has to do with the random selection.
The instruction is that, I should randomly select only 1 member(aged 12-17years)at random from the main roster to proceed the adolescents question.

I will be glad if anyone can guide me as how to go about it.

Thank you.

Re: How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 13th, 2022, 9:46 am
by sherrell
This has been discussed several times previously. Here's a link to one post that cites several others:

viewtopic.php?f=1&t=4906&p=15471&hilit=kish+grid#p15471

Sherrell

Re: How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 13th, 2022, 5:11 pm
by sham
Hi Sherrell,
Thanks for sharing..

Re: How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 25th, 2022, 8:16 pm
by sham
Hi Sherrell and Family,
I write to appreciate your support in helping me to improving my skills in Cspro programing.
@ Sherrell, After going through the link you suggested to us, I could not get exactly what I wanted. All the once that are there are about Random selection of at least 4 members and others. I took a step and came out with the logic based on the guide to resolve my issues but unfortunately I am not there yet.
The Randomized logic that I have at "ID_FROM_THE_ROSTER" keep selecting the same person among all the age group or cohort (eligibility) loosing its efficiency especially when we used different tablets, same randomized results is achieved.

In view of the above challenges I would like to attach a sample of my program to aid your understanding in helping to resolve my outstanding two(2) issues as stated below;.

1. At "ID_FROM_THE_ROSTER", I want the program to randomly select just 1 child between the age (12-17years) to proceed
2. If at "AVAIL" the response is option2(NO) and also option2(NO) at "REASON" respectively, the program should go back and run the random for the 2nd time un till another child is randomly selected

I would appreciate it if my issue is address as usual.
Thank you all for your continues guide and support.

sham.

Re: How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 26th, 2022, 10:59 am
by sherrell
In the helps for the random function it says:

>By default the sequence of random numbers generated by repeated calls to random will always be the same.
>You can use the seed function to generate a different sequence.

Try adding a call to the seed() function and see if that's better.

Sherrell

Re: How to Randomly select one(1) household member between the age of 12-17years from the roster

Posted: July 26th, 2022, 11:04 pm
by sham
Hi sherrell,
Thank you for your swift response once again.
Alright, I will give it a trial and revert.

I am always grateful for your time.

Thank you