Chapter 18(Creating Tabular Reports)
In this chapter, I am going to generate the report in tabular form. that displaying frequencies, percentages, and descriptive statistics (such as sums and means) broken by one or more CLASS variables.
Chapter#18 and Problem#1
All the problems, except Problem 10, use the SAS data set College.
Note: Data set College has permanent formats for Gender, SchoolSize, and Scholarship.
Either make this format catalog available to SAS (see Chapter 5), run the PROC
FORMAT statements here, or use the system option NOFMTERR (no format
error) that allows you to access SAS data sets that have permanent user-defined
formats without causing an error.
proc format;
value $yesno 'Y','1' = 'Yes'
'N','0' = 'No'
' ' = 'Not Given';
value $size 'S' = 'Small'
'M' = 'Medium'
'L' = 'Large'
' ' = 'Missing';
value $gender 'F' = 'Female'
'M' = 'Male'
' ' = 'Not Given';
run;
For each problem, you need to write the appropriate PROC TABULATE statements to
produce the given table.
Produce the following table. Note that the last row in the table represents all subjects.
Demographics from COLLEGE Data Set-
Solution:
Result:
Learning:
1# In this problem, I have learnt what happened when we use proc tabulate data step
2# proc tabulate uses a class statement to allow you to specify variables that represent category (often) character variable where we want to compute frequencies or percentage.
3# In this problem, gender, scholarship and schoolsize taken as a class variable and tables statement specify the appearance.
4# Any variable listed in a TABLE statement must be listed in a CLASS statement or a VAR statement (to be discussed shortly).
Chapter#18 and Problem #3
Produce the following table. Note that the ALL column has been renamed Total and
Gender has been formatted.
Demographics from COLLEGE Data Set
Solution:
Result:
Learning:
1# In this problem, I have broken down the school size in one or more variable of the class variable such as gender or school size.
2# Here, I have combined frequencies and descriptive statistics in single table.
3# School size broken into class gender, scholarship and school size.
No comments:
Post a Comment