Hi SAS community-
Below is a abbreviated version of an output from a proc freq.
ID Frequency Percent and so on . . .
a 4 0.40
b 2 0.20
c 1 0.10
d 1 0.10
e 1 0.10
f 1 0.10
I would like to view only the IDs that have a frequency of 2 or more (therefore would exclude IDs 'c-f').
Please advise as to how I can do this procedure.
Thanks!
Or, just use a where statement to eliminate the ids that don't meet your criterion. e.g.:
proc freq data=have;
tables id/out=want (where=(count ge 2));
run;
example:
proc freq data =sashelp.class noprint;
tables sex / out=temp ;
run;
data want;
set temp;
if count>9;
run;
Or, just use a where statement to eliminate the ids that don't meet your criterion. e.g.:
proc freq data=have;
tables id/out=want (where=(count ge 2));
run;
Thank you Art! - Linlin
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.