Friday 2 October 2015

SAS Basics By Ron Cody

Using the SAS data set BloodPressure, produce a report showing Gender, Age, SBP,        and DBP. Order the report in Gender and Age order

Code

Output



Using the SAS data set College, report the mean GPA for the following categories of ClassRank: 0–50 = bottom half, 51–74 = 3rd quartile, and 75 to 100 = top quarter. Do this by creating an appropriate format. Do not use a DATA step


Code 




Output


Using the data set Blood, produce frequencies for the variable Chol (cholesterol). Use a format to group the frequencies into three groups: low to 200 (normal), 201 and higher (high), and missing. Run PROC FREQ twice, once using the MISSING option, and once without. Compare the percentages in both listings. 


Code


Output




Produce the following table. Note that the keyword ALL has been renamed Total, Gender is formatted, and ClassRank (a continuous numeric variable) has been formatted into two groups (0–70 and 71 and higher). 

Code


Output 




. Produce the following table. Note that the ALL column has been renamed Total.


 Code


Output