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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 523 views
  • 0 likes
  • 2 in conversation