Count numer of subjects with same reference ID

Reply
Frequent Contributor
Frequent Contributor
Posts: 101

Count numer of subjects with same reference ID

I have the following dataset. I need to count the number of subjects per REF. Any easy way to do this?? Thanks. Protocol SID (subjects) REF 1 101 1 1 101 1.1 1 101 2 1 101 3 1 101 4 1 101 5 1 102 1 1 102 1.1 1 102 2 1 102 3 1 102 4
Frequent Contributor
Frequent Contributor
Posts: 101

Count number of patients with unique REF number

I have the following dataset. I need to count the number of subjects per REF. Any easy way to do this?? Thanks.

Protocol SID (subjects) REF

1 101 1

1 101 1.1

1 101 2

1 101 3

1 101 4

1 101 5

1 102 1

1 102 1.1

1 102 2

1 102 3

1 102 4

Super Contributor
Posts: 305

Re: Count number of patients with unique REF number

Hello,

 

A lot of ways to do it. If you search the forum or the internet you'll come across: proc freq, proc means, sql, data step etc.

Frequent Contributor
Frequent Contributor
Posts: 101

Re: Count number of patients with unique REF number

any one solution please? thanks

Grand Advisor
Posts: 17,420

Re: Count number of patients with unique REF number

Can you have duplicate IDs per Ref? 

 

If not a basic proc freq will work. 

 

Do you need the output displayed or a dataset?

 

proc free Data=have;
Table ref;
Run;
Frequent Contributor
Frequent Contributor
Posts: 101

Re: Count number of patients with unique REF number

Hi Reeza,

 

thanks for quick response

 

ID's are unique per protocol number. 

 

How to count to number of patients with unique REF number grouped by protocol number??

 

 

 

Grand Advisor
Posts: 17,420

Re: Count number of patients with unique REF number

This page goes over how to get basic descriptive stats using SAS

 

http://www.ats.ucla.edu/stat/sas/modules/descript.htm

Ask a Question
Discussion stats
  • 6 replies
  • 333 views
  • 0 likes
  • 3 in conversation