stat 440 lab exercises 15
stat 440 lab exercises 15
SAS Output
Flights from San Francisco by Day of Week
Cumulative Cumulative
DepartDay Frequency Percent Frequency Percent
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
1 6 11.54 6 11.54
2 13 25.00 19 36.54
3 5 9.62 24 46.15
4 7 13.46 31 59.62
5 7 13.46 38 73.08
6 8 15.38 46 88.46
7 6 11.54 52 100.00
b. Use PROC FREQ to create a report using the st.sanfran data set that displays the
frequency count for each Destination. Add an appropriate title.
SAS Output
Flights from San Francisco
Cumulative Cumulative
Destination Frequency Percent Frequency Percent
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
ANC 10 19.23 10 19.23
HND 8 15.38 18 34.62
HNL 3 5.77 21 40.38
RDU 6 11.54 27 51.92
SEA 25 48.08 52 100.00
c. You can specify many options in the TABLES statement to control the calculations and
appearance of a frequency table. The NOCUM option suppresses the printing of the
cumulative frequencies and cumulative percentages. You can specify options in a
TABLES statement in the following way:
tables variable / options;
Recall your program from Exercise 1.b and add the NOCUM option to the TABLES
statement.
Statistics 440: Lab Exercises 15
SAS Output
Flights from San Francisco
d. Use PROC FREQ to create a report using the st.sanfran data set that displays the
frequency count for each Destination by DepartDay. Remove the title after this
report since it doesn’t apply to the next exercise.
Partial SAS Output
Flights from San Francisco
Destination
DepartDay
Frequency‚
Percent ‚
Row Pct ‚
Col Pct ‚ 1‚ 2‚ 3‚ 4‚ Total
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
ANC ‚ 0 ‚ 3 ‚ 1 ‚ 1 ‚ 10
‚ 0.00 ‚ 5.77 ‚ 1.92 ‚ 1.92 ‚ 19.23
‚ 0.00 ‚ 30.00 ‚ 10.00 ‚ 10.00 ‚
‚ 0.00 ‚ 23.08 ‚ 20.00 ‚ 14.29 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
HND ‚ 1 ‚ 2 ‚ 1 ‚ 3 ‚ 8
‚ 1.92 ‚ 3.85 ‚ 1.92 ‚ 5.77 ‚ 15.38
‚ 12.50 ‚ 25.00 ‚ 12.50 ‚ 37.50 ‚
‚ 16.67 ‚ 15.38 ‚ 20.00 ‚ 42.86 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
HNL ‚ 0 ‚ 0 ‚ 0 ‚ 0 ‚ 3
‚ 0.00 ‚ 0.00 ‚ 0.00 ‚ 0.00 ‚ 5.77
‚ 0.00 ‚ 0.00 ‚ 0.00 ‚ 0.00 ‚
‚ 0.00 ‚ 0.00 ‚ 0.00 ‚ 0.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
RDU ‚ 2 ‚ 1 ‚ 1 ‚ 0 ‚ 6
‚ 3.85 ‚ 1.92 ‚ 1.92 ‚ 0.00 ‚ 11.54
‚ 33.33 ‚ 16.67 ‚ 16.67 ‚ 0.00 ‚
‚ 33.33 ‚ 7.69 ‚ 20.00 ‚ 0.00 ‚
ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ
Statistics 440: Lab Exercises 15
Cumulative Cumulative
Gender Frequency Percent Frequency Percent
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
B 1 2.94 1 2.94
F 17 50.00 18 52.94
G 1 2.94 19 55.88
M 15 44.12 34 100.00
Frequency Missing = 1
b. Assume that the values ‘B’ and ‘G’ in Gender were errors made in data-entry and were
meant to be ‘M’ and ‘F’ respectively. Correct these values in the st.mechanics data
set. Rerun the frequency reports from part a. to check whether the changes have been
made.
b. Modify the previous report to display the data for each Destination. Limit the
number of decimal places in the output to two. The output shown below is only partial
output; all statistics should display in your report.
Partial SAS Output
The MEANS Procedure
N
Destination Obs Variable N Mean Std Dev
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
ANC 10 CargoRev 10 35811.30 4458.74
TotPassCap 10 257.60 11.69
N
Destination Obs Variable Minimum Maximum Mean
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
ANC 10 CargoRev 31992.00 44643.00 35811.30
TotPassCap 238.00 267.00 257.60
additional information do you get from PROC UNIVARIATE that you do not get from PROC
MEANS?
Portions Copyright 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.
Reproduced with permission of SAS Institute Inc., Cary, NC, USA. SAS Institute Inc. makes no
warranties with respect to these materials and disclaims all liabilities thereof.
Statistics 440: Lab Exercises 15