Scenario 7

Directions

This scenario uses the Cert.Temp18 data set. Write a SAS program to do the following:
  • Create a temporary SAS data set that uses Cert.Temp18 and store the results as Work.Scenario7.
  • Format the Day variable so that the date appears as 01JAN2018.
  • Use a function to create a variable named Month that is equal to the numeric value of the month of the Day variable. For example, if the month is January, Month=1, if the month is February, Month=2, and so on.
  • Create a one-way frequency table using the variable HighTemp.
  • Use PROC MEANS to calculate the mean and standard deviation for the variables AvgHighTemp and AvgLowTemp by the new Month variable.

Test Your Code

  1. What is the frequency for a HighTemp of 63?
  2. What is the HighTemp on January 12, 2018?
  3. What is the mean for AvgLowTemp for Month=1? (Round your answer to the nearest integer.)
  4. What is the standard deviation (std) for AvgHighTemp for Month=3? (Round your answer to two decimal places.)

Objectives Accomplished

  • Use a DATA step to create a SAS data set from an existing SAS data set.
  • Use SAS date and time formats to specify how the values are displayed.
  • Use assignment statements to create new variables and assign a value in the DATA step.
  • Use SAS functions to manipulate character data, numeric data, and SAS date values.
  • Generate summary reports and frequency tables using Base SAS procedures.
Last updated: February 14, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset