Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distribution of number

Status
Not open for further replies.

irinnew

Technical User
Mar 19, 2005
81
US
Hi everybodu

I have a table of members who had a certain medical test . There are multiple Mem_IDs of the same members who did the certain kind of test multiple times in different time.

What I need is to do a distribution of number of tests per member.

So my understanding is that :

1st I need to create an additional field (Number of Tests) and calculate numbers

Mem_id Number_of_ tests

aaaaaaaaa 3
aaaaaaaaa 3
aaaaaaaaa 3
aaaaaaaaa 3
bbbbbbbbb 2
bbbbbbbbb 2
ccccccccc 1

2nd I need to use distinct option to have single records like that:

aaaaaaaaa 3
bbbbbbbbb 2
ccccccccc 1

3rd:
Prc Freq data=mylastdataset;
Tables Number_of_ tests;
Title “Distribution of numbers of tests PER MEMBER”;
Run;

I do not know however how to implement the very first part (to calculate numbers)?

Also…do you think this is a correct way to resolve the WHOLE problem?


Thank you in advance

Irin



 
Irin,
You can easily get a count of memberid's with a proc sql like this.

proc sql;
create table test as
select memid, count(memid) as testtot
from your_dataset
group by memid;
quit;

Then do your proc freq for the distribution.
Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top