BookmarkSubscribeRSS Feed
sonyk
Calcite | Level 5
Hi
I have a table of labtesting where i have the columns cardio ,Repiratory ,abdomen etc.How to find the frequncy and percent of values in those columns(under cardio i have NAD NS S1S2N).My resulting table shud look like the below.



N Percent
Cardio
NAD 5 25
Ns 10 30
S1S2N 5 25

Respiratory
Clear NVBS 5 25
NAD 10 30

Central Nervous System
Clinically N 12 45
NAD 5 35
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
You did not say what you destination of choice was, or whether you wanted to see the report in one big table or in smaller tables (one for Cardio, one for Respiratory, etc).

It really depends on how you want the results to appear. These examples with SASHELP.SHOES can help you contrast the way the output looks with PROC TABULATE (one big table by default) versus PROC FREQ (a separate table for each variable by default).

cynthia
[pre]
ods listing close;
ods html file='c:\temp\use_tab_freq.html' style=sasweb;

proc tabulate data=sashelp.shoes;
title '1) TABULATE approach';
where region in ('Asia', 'Pacific','Canada') and
product in ('Sandal', 'Slipper');
class product region;
table product region,
n pctn;
keylabel n='Frequency'
pctn = 'Percent';
run;

proc freq data=sashelp.shoes;
title '2) FREQ approach';
where region in ('Asia', 'Pacific','Canada') and
product in ('Sandal', 'Slipper');
tables product region / nocum;
run;
ods html close;
[/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
  • 671 views
  • 0 likes
  • 2 in conversation