Date: Mon, 27 Aug 2007 15:16:10 -0000
Reply-To: Haris <Karovaldas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Haris <Karovaldas@GMAIL.COM>
Organization: http://groups.google.com
Subject: How to count in sub-sets of a continuous variable?
Content-Type: text/plain; charset="iso-8859-1"
I have a dataset with multiple rows per ID. Each of the rows has a
unique time stamp. I want to count how many ID's have data within
certain time windows. Here's a code that counts the number of rows in
each time-window.
proc sql ;
title 'N of Patients and Visits during FU by Procedure' ;
select count('CTU-ID'n) label='Total Visits',
count (unique 'CTU-ID'n) label='Total Patients',
sum(Days LE 30) label='Visits within 30 Days',
sum(Days between 31 and 90) label='Visits 31 to 90 Days',
sum(Days between 91 and 180) label='Visits 91 to 180 Days',
sum(Days between 181 and 270) label='Visits 181 to 270 Days',
sum(Days GT 270) label='Visits 270+ Days'
from AFLee.Merged ;
quit ; title ;
How do I make it count not rows, but unique IDs within those windows?
Thanks.
|