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

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

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

Post 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.
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

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

Post 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
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

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

Post by sham »

Hi Sherrell,
Thanks for sharing..
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

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

Post 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.
Attachments
Randomize.zip
(35.39 KiB) Downloaded 110 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

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

Post 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
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

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

Post 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
Post Reply