sas ® regression essentials. 2 list the components of a sas program. open an existing sas program...
Post on 21-Dec-2015
236 views
TRANSCRIPT
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 one; INPUT Name $ Gender $ Runtime Age Weight ;
DATALINES;Donna F 8.17 42 68.15 Gracie F 8.63 38 81.87Luanne F 8.65 43 85.84Mimi F 8.92 50 70.87Chris M 8.95 49 81.42;RUN;
PROC PRINT DATA=one;RUN;
PROC REG DATA=one;MODEL Runtime=Weight;RUN;
DATAStep
PROCSteps
SAS Programs
6
Open the SAS program “example.sas.”
Submit the program and examine the results.
Data for today's class located at
http://www.missouri.edu/~baconr/sas/reg
Exercises
7
Learn the two fundamental SAS syntax programming rules.
Learn to create a SAS dataset from text data. Locate the data for this course Write a Data Step to read a course data file.
Objectives
8
SAS statements have these characteristics: usually begin with an identifying keyword always end with a semicolon
data staff; input LastName $ FirstName $ JobTitle $ Salary;datalines;…insert text here…run;
proc print data=staff;run;
Fundamental SAS Syntax Rules
Example of a typical text data set.
Name Gender Runtime Age WeightDonna F 8.17 42 68.15 Gracie F 8.63 38 81.87Luanne F 8.65 43 85.84Mimi F 8.92 50 70.87Chris M 8.95 49 81.42
DATA one; INPUT Name $ Gender $ Runtime Age Weight;
DATALINES;Donna F 8.17 42 68.15 Gracie F 8.63 38 81.87Luanne F 8.65 43 85.84Mimi F 8.92 50 70.87Chris M 8.95 49 81.42;RUN;
PROC PRINT DATA=one;RUN;
Creating a SAS data set: The Data Step
Data set from kknm directory on my website
PERSON SBP AGE 1 144 39 2 220 47 3 138 45 4 145 47 5 162 65 6 142 46 7 170 67 8 124 42 9 158 67 . . .
13
Write a SAS program to read the data located in the “sbp.txt” text file.
http://www.missouri.edu/~baconr/sas/KKNM_DATA
Exercises