Freq Procedure: For Creating Frequency Tables & Contingency Tables
Freq Procedure: For Creating Frequency Tables & Contingency Tables
PROCEDURE
For creating frequency tables &
contingency tables
FREQ PROCEDURE
proc
proc freq
freq Data=new;
Data=new;
tables
tables aa // missprint;
missprint;
title
title '1-WAY
'1-WAY FREQUENCY
FREQUENCY TABLE
TABLE WITH
WITH MISSPRINT
MISSPRINT
OPTION';
OPTION';
run;
run;
Data SummerSchool
Background
High school students applied for
courses in a summer enrichment
program; these courses included
journalism, art history, statistics,
graphic arts, and computer
programming. The students accepted
were randomly assigned to classes
with and without internships in local
companies.
Investigation
Researchers are interested in whether
there is an association between
internship status and summer
program enrollment. The Pearson chisquare statistic is an appropriate
proc
proc freq
freq data=SummerSchool
data=SummerSchool
statistic to assess the association in
order=data;
order=data;
the corresponding table.
tables
tables Internship*Enrollment
Internship*Enrollment // chisq;
chisq;
weight
weight Count;
Count;
Analysis of distributions
of variables
PROC UNIVARIATE
Data Gains
MORE
OUTPUT
ON NEXT
PAGE
MORE
OUTPUT
ON NEXT
PAGE
Percentile points
pctlpre= h w ;
run;
Note: Use proc print to print data UNIGAIN
BasicMeasures
ExtremeObs
ExtremeValues
Frequencies
LocationCounts
MissingValues
Modes
Moments
Plots
Quantiles
RobustScale
SSPlots
TestsForLocation
TestsForNormality
TrimmedMeans
Description
Confidence intervals
for mean, standard
deviation, variance
Measures of location
and variability
Extreme observations
Extreme values
Frequencies
Counts used for sign
test and signed rank
test
Missing values
Modes
Sample moments
Line printer plots
Quantiles
Robust measures of
scale
Line printer side-byside box plots
Tests for location
Tests for normality
Trimmed means
Option
CIBASIC
Default
Default
NEXTRVAL=
FREQ
LOCCOUNT
Default, if missing
values exist
MODES
Default
PLOTS
Default
ROBUSTSCALE
PLOTS (with BY
statement)
Default
NORMALTEST
TRIMMED=
Variability
Mean
121.2727
Median
120.0000
Mode
120.0000
S
y
s
t
o
l
i
c
a
n
d
Std Deviation
14.28346
Variance
204.01732
Range
69.00000
Interquartile Range
13.00000
D
Quantiles (Definition
5)
i
Quantile
100% Max
99%
95%
90%
75% Q3
50% Median
a
s
t
o
l
i
c
B
l
o
o
d
P
r
e
s
s
u
r
e
Estimate
165
165
140
134
125
120
25% Q1
112
10%
108
5%
100
1%
96
0% Min
96
Data BPressure;
Set BPressure;
Run;
Number
Winsorized
in Tail
Winsorized
Mean
Std Error
Winsorized
Mean
13.64
120.64
2.42
95%
Confidence
Limits
115.48
125.78
DF
t for H0:
Mu0=0.00
Pr > |t|
15
49.9102
<.0001
Trimmed Means
Percent
Trimmed
in Tail
Number
Trimmed
in Tail
Trimmed
Mean
Std Error
Trimmed
Mean
DF
t for H0:
Mu0=0.00
Pr > |t|
4.55
120.3500
2.573536
114.9635
125.7365
19
46.76446
<.0001
13.64
120.3125
2.395387
115.2069
125.4181
15
50.22675
<.0001
Value
Estimate
of Sigma
IInterquartile Range
13.00000
9.63691
15.03030
13.32026
MAD
6.50000
9.63690
Sn
9.54080
9.54080
Qn
13.33140
11.36786
Q3-Q1
Quantile-Quantile Plots:
Agreement of empirical distribution with theoretical
distribution
Q-Q Plots
Reference theoretical distribution : Normal with estimated mean an