Date: Wed, 22 Feb 2006 11:13:15 -0800
Reply-To: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject: Re: studying repeats
Content-Type: text/plain; charset="us-ascii"
Hi Lori,
PROC FREQ is great for these stats:
You can use your concatenated field
with:
table yourfield / list missing
or you can leave them separate and
PROC FREQ will do it for you:
data sample;
zip=11111; period='A'; output;
zip=11111; period='B'; output;
zip=22222; period='A'; output;
zip=22222; period='A'; output;
zip=22222; period='A'; output;
zip=22222; period='B'; output;
zip=33333; period='A'; output;
zip=33333; period='B'; output;
zip=33333; period='B'; output;
zip=44444; period='C'; output;
run;
proc freq data=sample noprint;
table zip*period / list missing
out=result(where=(count ne 1));
run;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
On Tue, 21 Feb 2006 14:02:02 -0800, lrbowes2@yahoo.com
<lrbowes2@YAHOO.COM>
wrote:
>Hi.
>
>I need to look at how many times and which various combinations of data
>are repeated (zip code and time period). (Ideally, there should only
>be one instance of each zip code, time period combo, so I want to learn
>more about cases where that is false.) I created a variable that is
>the concatenation of the values of zip code and time period. What is
>the best way of getting summary stats on the repeats?
>
>I don't want to just use nodup because I want to know what was repeated
>and how many times it was repeated.
>
>Ideally, I guess I would maybe do a proc freq on the concatenated
>variable, but I want to get rid of all instances where the frequency is
>1.
>
>Thanks.
>
>-Lori