SAS ® ANOVA Essentials. 2 List the components of a SAS program. Open an existing SAS program and...
-
Upload
garry-brooks -
Category
Documents
-
view
225 -
download
0
Transcript of SAS ® ANOVA Essentials. 2 List the components of a SAS program. Open an existing SAS program and...
3
DATA steps are typically used to create SAS data sets.
PROC steps are typically used to process SAS data sets (that is, generate reports and graphs, edit data, and sort data).
A SAS program is a sequence of steps that the user submits for execution.
RawData
RawData
DATAStep
DATAStep
ReportReport
SASDataSet
SASDataSet
PROCStep
PROCStep
SAS Programs
4
data staff; infile 'raw-data-file'; input LastName $ 1-20 FirstName $ 21-30 JobTitle $ 36-43 Salary 54-59;run;
proc print data=staff;run;
proc means data=staff; class JobTitle; var Salary;run;
DATAStep
PROCSteps
SAS Programs
5
data staff; infile 'raw-data-file'; input LastName $ 1-20 FirstName $ 21-30 JobTitle $ 36-43 Salary 54-59;run;
proc print data=staff;
proc means data=staff; class JobTitle; var Salary;run;
Step Boundaries
8
Explain SAS syntax rules. State the naming conventions for SAS data sets
and variables. Create a SAS data set from a text dataset from your
textbook.
Objectives
9
SAS statements have these characteristics: usually begin with an identifying keyword always end with a semicolon
data work.staff; infile 'raw-data-file'; input LastName $ 1-20 FirstName $ 21-30 JobTitle $ 36-43 Salary 54-59;run;
proc print data=work.staff;run;
proc means data=work.staff; class JobTitle; var Salary;run;
SAS Syntax Rules
10
Numeric values
Variable
names
Variable
values
LastName FirstName JobTitle Salary
TORRES JAN Pilot 50000LANGKAMM SARAH Mechanic 80000SMITH MICHAEL Mechanic 40000WAGSCHAL NADJA Pilot 77500TOERMOEN JOCHEN Pilot 65000
The data portion of a SAS data set is a rectangular table of character and/or numeric data values.
Character values
SAS Data Sets:
SAS Variable Names can be up to 32 characters long, must start with a letter or underscore. Subsequent characters can be letters, underscores, or numerals.
11
Accessing Data Sources
Data Entry
Raw Data File
Other Software File
DATA Step
SAS/ACCESS Software
SASData Set
FSEDITFSVIEW
Conversion Process
12
Data for this course is located on the
CDROM at back of book
and at
http://apps.csom.umn.edu/Nachtsheim/5th/
Data for this course
DATA one; INPUT Name $ Gender $ Runtime Age Weight Oxygen_Consumption Run_Pulse Rest_Pulse Maximum_Pulse Performance;DATALINES;Donna F 8.17 42 68.15 59.57 166 40 172 14Gracie F 8.63 38 81.87 60.06 170 48 186 13Luanne F 8.65 43 85.84 54.3 156 45 168 13Mimi F 8.92 50 70.87 54.63 146 48 155 11Chris M 8.95 49 81.42 49.16 180 44 185 11;
PROC PRINT DATA=one;RUN;
Creating a SAS data set: DATALINES statement.
14
The ANOVA.txt file contains several of the most common SAS procedures used your class.
During the remainder of this class, we will open that text file discuss the function of each of the procedures and demo it in SAS.
SAS Procedures