The solution listed
below is one example of a program that could be used to accomplish
each task within the scenario. Your code can be different, as long
as it results in the same answers.
data work.scenario7; /*#1*/
set cert.temp18; /*#2*/
format Day date9.; /*#3*/
Month=month(day); /*#4*/
run;
proc freq data=work.scenario7; /*#5*/
tables HighTemp; /*#6*/
run;
proc means data=work.scenario7; /*#7*/
class month; /*#8*/
var AvgLowTemp AvgHighTemp; /*#9*/
run;
1 |
The DATA step creates a new temporary
data set named Work.Scenario7.
|
2 |
The SET statement is used to read
observations from one or more SAS data sets.
|
3 |
The FORMAT statement formats the
Day variable in the date9. format.
|
4 |
The MONTH function returns the
numeric value of the month within the Day variable.
|
5 |
The FREQ procedure creates one-way,
two-way, and n-way tables.
It also describes data by reporting the distribution of variable values.
|
6 |
The TABLES statement requests one-way
to n-way frequency and crosstabulation
tables and statistics. In this case, that is a one-way frequency with
the default statistics for the variable HighTemp.
|
7 |
The MEANS procedure is used to
compute descriptive statistics for the variables stated in the VAR
statement.
|
8 |
The CLASS statement provides separate
calculations for each value of the Month variable.
|
9 |
The VAR statement identifies the
two variables, AvgLowTemp and AvgHighTemp, as the analysis variables,
and also controls their order in the output.
|
Output A2.9 PROC FREQ Results of High Temp
Output A2.10 PROC MEANS Results