Chapter 10 Data Presentation

Chapter 10 Data Presentation - STAT1303 Data Management 10....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT1303 Data Management 10. Data Presentation 10 Data Presentation In many occasions, nice formatted reports are required. For example, PROC FREQ and PROC MEANS can give summary statistics reports. However, they are rather primitive in terms of report formats and layouts. In Chapter 3, we learnt the labels and formats can improve the quality of report output by adding more meaningful headings and data value descriptions. In this chapter, we consider the enhancement of the appearance of reports in two possible ways: (1) PROC TABULATE generates more ±exible reports for categorical and numerical data and (2) PROC REPORT can produce more fancy reports. 10.1 Label Data Values in PROC TABULATE PROC TABULATE constructs tables of descriptive statistics for numeric variables as well as tables of counts and percentages for categorical variables. Typically, the syntax of this procedure is presented below PROC TABULATE DATA= data-set <options> ; CLASS variable-list ; VAR variable-list ; TABLE table-expression </options> ; BY variable-list ; FORMAT var-1 format-1 <var-2 format-2 . ..> ; LABEL var-1=’label-1’ <var-2=’label-2’ . ..> ; KEYLABEL keyword-1=’description-1’ <keyword-2=’description-2’ . ..> ; Report layout can be customized by user through the TABLE statement. A large varieties of report layout are supported by the PROC TABULATE .Forthestatisticsand counts, they can be grouped by classi²cation variables de²ned in CLASS statement. Also, they can be labelled by a more meaningful description through the KEYLABEL statement. The LABEL and FORMAT statements give even nicer formatted reports. Suppose a data set PROPERTY contains the variables YEAR, SALE, RENT, AREA and SIZE. The variables AREA and SIZE are of character type. The labels for the variables are de²ned permanently by using the LABEL statement in Data Step. The formats for the values of AREA and SIZE are de²ned permanently while the format PRICERAN is a temporary format de²ned for the variable SALE. The de²nition of formats is carried out by the following example. HKU STAT1303 (2011-12, Semester 1) 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STAT1303 Data Management 10. Data Presentation Example 10.1. Defne the Format oF variables oF the data set PROPERTY. *Example10.1-propertydatas e t ; libname mylib ’D:/temp’; proc format; value $area ’1’=’Hong Kong’ ’2’=’Kowloon’ ’3’=’New Territories’; value $size ’1’=’<40 sq. m’ ’2’=’40-69.9 sq. m’ ’3’=’70-99.9 sq. m’ ’4’=’100-159.9 sq. m’ ’5’=’>160 sq. m’; value priceran low - <35000 = ’Low’ 35000 - <50000 = ’Medium’ 50000 - high = ’High’; run; data property; set mylib.property; format area $area. size $size.; label area=’Area’ size=’Size of premise’ sale=’Sale price’ rent=’Rental price’; run; To construct an one-way table, we attempt to use PROC TABULATE and restrict the observations when YEAR is 2000 in Example 10.2.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2012 for the course STAT 1301 taught by Professor Smslee during the Spring '08 term at HKU.

Page1 / 18

Chapter 10 Data Presentation - STAT1303 Data Management 10....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online