Description
Problem 1. (Use PROC SQL wherever possible). Use the SAS dataset snowstationsdata.sas7bdat, to answer the following questions:
1. How many lines does the file contain?
2. What are the variable names in the imported file? (Hint: use proc contents).
3. How many different snow stations are the data given for?
4. How many years have been the data recorded for each station?
5. Make an ordered list of years and give the number of stations that had measurements that year.
6. Compute the highest value of max_SWE for each station. (Note: max_SWE=maximum annual Snow Water Equivalent). Order by station name.
7. You might have noticed by now that a station name ‘ADIN MOUNTAIN’ had been misspelled as ‘ADIN MOUTAIN’. Fix this typo.
8. How many different regions are involved in snow data collection?
9. How many stations are there in each region?
10. Create a data set that contains variables STATION_ID, STATION_NAME, TOTAL_MAX_SWE, REGION, ELEVATION, LATITUDE, and LONGITUDE, and which entries are the snow stations that had been in operation for the most recent 50 years (from 1963 to 2012). That is, you have to take the stations that have records from 1963 to 2012, and compute the highest max_SWE values (call the TOTAL_MAX_SWE) over the duration of these 50 years.
1
relates to its Academic Performance Index (API). They procured publically available API information for all schools in that region (file api.sas7bdat). Answer the following questions:
1. Add the column of API scores to the surveyresults.sas7bdat file. Hint: merge the two files on SchoolName and remove all entries for which q1 values are missing. Double-check that your resulting file contains the 347 schools.
2. Impute the three missing values for q2 by the mean of the entire column. Hint: you should compute that mean and make it a global macro variable.
3. Compute the total of the survey results (variable “Total”). The total in this case is defined as the sum of:
q1, q2,
the mean of q3a through q3h, reverse coded q4,
q5, q6, reverse coded q7, and the mean of q8a through q8e.
Reverse coded variable is defined by the recoding 0 into 4, 1 into 3, 2 into 2, 3 into 1, and 4 into 0. Hint: reverse coding can be accomplished with one simple arithmetic operation.
4. Plot Total versus API. Present the graph.
2




Reviews
There are no reviews yet.