Date: Sun, 21 Mar 2010 16:43:14 -0700
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: getting unique ID observations
Content-Type: text/plain; charset=ISO-8859-1
On Mar 20, 5:18 pm, sas analysis <sasanaly...@gmail.com> wrote:
> This is yet a simple question which I am not knowing how to do in sas:
>
> I have a longitudinal dataset and I need to get how many unique
> observations there are for each variable.
>
> For example, if i have 5430 subjects and 80,000 observations. how do I
> get unique observations for each variable based on the 5430 (how many
> of the total 5430 said yes to smoking or no, even though smoking was
> measured more than 20 times?)
>
> any help would be great.
If you have coded your variables as numeric then use PROC MEANS/
SUMMARY to get the MAX (or MIN depending on your coding) per subject.
proc summary data=in ;
class id;
var smoke ;
output out=out max= ;
run;
proc means data=out ;
run;
|