Chapter 4. Procedures for data summarization

Chapter 4. Procedures for data summarization - 1 Procedures...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Procedures for data summarization 2 ¡ Introduction to SAS procedures ¡ PROC PRINT ¡ PROC FREQ ¡ PROC SORT ¡ PROC MEANS ¡ PROC UNIVARIATE ¡ Saving results as SAS data sets 3 Introduction ¡ Procedures (PROCs) in BASE SAS module ¢ mainly for data summarization ¢ Giving descriptive statistics about the data ¡ Descriptive statistics play a role in many data management tasks ¢ Data presentation – a few reports, tables, and graphs can give interested party most of the information they want ¢ Data cleaning and validation –errors in data collection and data entry quite often result in observations ‘different’ from the other observations. By identifying unusual observations, one may spot these error ¢ Data exploration – exploring the structure and the relationships of variables in the data, as well, as the patterns of unusual observations helps in understand the data ¢ Summary statistics may be useful in data manipulations and preparation tasks 4 SAS PROCs ¡ SAS PROCs are pre-written programs ¡ Using a PROC is like filling out of a form ¢ Fill in the blanks and choose from a list of options ¡ Each PROC has its own unique form with its own list of options ¡ All PROCs have required statements and most have optional statements. ¢ Print procedure requires only PROC PRINT; ¡ You can add many optional statements to PROC PRINT 5 Basic structure of a SAS PROC ¡ All PROCs start with a PROC statement and followed by a number of required / optional statements. A new Data Step (DATA statement), a new PROC (PROC statement), a RUN statement end the current PROC ¡ A PROC statement starts with the keyword PROC followed by the name of the procedure. Options follow the procedure name ¡ Options/statements common to all procedures ¢ PROC procedure_name DATA = data_option; ¢ BY by_details; ¢ LABEL label_details; ¢ WHERE where_details; 6 PROC PRINT ¡ Main function is to print observations in a data set. It can be as simple as ¢ PROC PRINT data=contact; ¡ PROC PRINT takes the form PROC PRINT DATA= data-set NOOBS LABEL ; VAR var-list ; ID var-list ; SUM var-lis t; BY var-list ; LABEL var = var-label …; WHERE expression ; 7 ¡ Words in blue are required keywords and words in green are optional ¢ data-set is a data set name ¢ var-list is a list of variables in the data set data-set ¢ var is a variable ¢ var-label is a character constant ¢ expression is a SAS expression ¡ More optional statements described in SAS Procedure Guide 8 Example ¡ Data set: trade ¢ Imports, Retained Imports and Re-exports by End- use Category ¡ Variables ¢ Year ¡ 1995, 2000-2005 ¢ Category ¡ 1=Foodstuffs, 2=Consumer goods, 3=Raw materials and semi-manufactures, 4=Fuels, 5=Capital goods ¢ Type ¡ 1=Imports , 2=Retained imports, 3=Re-exports ¢ Amount ¡ $ million 9 * Example 4.1 trade data set; data trade; input year category type amount; cards; 1995 1 1 61158 2000 1 1 63671 2001 1 1 60353 ......
View Full 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 / 76

Chapter 4. Procedures for data summarization - 1 Procedures...

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

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