Help using Base SAS procedures

proc freq ques

Reply
Occasional Contributor
Posts: 9

proc freq ques

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
SAS Super FREQ
Posts: 8,743

Re: proc freq ques

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]
Ask a Question
Discussion stats
  • 1 reply
  • 149 views
  • 0 likes
  • 2 in conversation