BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have the following code, I am a beginner SAS programmer;

I am trying to find the maximum number of frequency in category DIA_1 I think that I should sort by Patient ID first then find DIA_1 is that correct. How could I program: This is what I came up with but its wrong. Thanks.

proc sort data = report.FY08_datanodup;
by PAT_ID descending DIA_1;
run;
proc freq data = report.FY08_datanodup;
by DIA_1;
run; Message was edited by: RHUB
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Proc FREQ needs a TABLES statement so it knows which variables you want to get information about. Read the documentation on Proc FREQ
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/freq_toc.htm
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_freq_sect010.htm
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_freq_sect023.htm

and experiment with these 2 programs that use SASHELP.SHOES. That approach might help you come up with syntax that works for your desired report.

cynthia
[pre]
ods listing;
proc freq data=sashelp.shoes;
title 'Table on Product Only';
by region;
tables product;
run;

proc freq data=sashelp.shoes nlevels;
title ' With NLEVELS option and no BY';
tables region product;
run;
[/pre]

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 531 views
  • 0 likes
  • 2 in conversation