Hi,
The code below creates a table of the number of observation with the value "infinity" in the variable "tim_diff", for each variable observation "etikett".
I have made it so that the table is sorted in order of frequencies (order=freq).
My problem is that I want to choose just the 50 highest observations. I.e. the 50 observations in "etikett" with the highest number of frequencies in "tim_diff".
I have tried "(obs=50), but then it just chooses the first 50 observations, not the ones with the highest frequencies. Does anyone have a suggested solution to the problem?
proc freq data=Timlon order=freq nlevels;
table etikett*tim_diff / nopercent norow nocol list missing;
where tim_diff=.I;
run;
Thanks in advance!
Best regards,
Hank
This usually requires 2 steps one to summarize and another to select the top freqs.
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.