turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- proc surveyselect to split the data to two groups

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2015 12:28 PM

We have physician data with taxID and need to split them equally to two groups. We want to keep the physicians together under same taxID.

First, we use the below coding to assign 0 and 1 based on taxID.

proc surveyselect data=test samprate=0.50 seed=49201 out=Sample outall

method=srs noprint;

run;

Then, they ask whether we could have a list which also consider the size of taxID(the physicians number), because each taxID have a vary number of physicians. For example, they probably have 1 physician or 20 physicians under each taxID.

So, the current question is how to split all of the taxID to 2 groups randomly, which also make sure they have similiar amount physicians under each group.

Thanks,

Kui

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2015 01:44 PM

Do you want a sample of physicians or of TaxIds?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2015 01:48 PM

sample of taxID. And also consider the number of physicians under the taxID

Thanks,

Kui

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2015 04:25 PM

If I sort taxID by number of physician, then randomly assign them to two groups, I guess, they might have similar physician number.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2015 05:20 PM

Technically putting another requirement on the resulting sample changes the "random selection" behavior you may have chosen. One approach would be to have a summary of the TaxId with the number of physicians at each. Select a sample of TaxIds in your groups/strata what ever. Examine the sum of physicians. If the number is too far apart, rerun the sample until you get something "close enough". But you are playing somewhat loose with the probability of selection and resulting weights.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 09:56 AM

Thanks for your time and suggestions.