Download presentation
Presentation is loading. Please wait.
1
SAS® Regression Essentials
2
Objectives List the components of a SAS program.
Open an existing SAS program and run it.
3
SAS Programs A SAS program is a sequence of steps that the user submits for execution. Raw Data DATA steps are typically used to create SAS data sets. SAS Data Set DATA Step PROC Step Report SAS Data Set PROC steps are typically used to process SAS data sets (that is, generate reports and graphs, edit data, and sort data).
4
SAS Programs DATA Step PROC Steps DATA one;
INPUT Name $ Gender $ Runtime Age Weight ; DATALINES; Donna F Gracie F Luanne F Mimi F Chris M ; RUN; PROC PRINT DATA=one; PROC REG DATA=one; MODEL Runtime=Weight; DATA Step PROC Steps
5
SAS Windowing Environment
Interactive windows enable you to interface with SAS.
6
Exercises Open the SAS program “example.sas.”
Submit the program and examine the results. Files for today's class located at
7
Objectives 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.
8
Fundamental SAS Syntax Rules
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;
9
Example of a typical text data set.
Name Gender Runtime Age Weight Donna F Gracie F Luanne F Mimi F Chris M
10
Creating a SAS data set: The Data Step
DATA one; INPUT Name $ Gender $ Runtime Age Weight; DATALINES; Donna F Gracie F Luanne F Mimi F Chris M ; RUN; PROC PRINT DATA=one;
11
Example of a typical text data set.
‘Name’,‘Gender’,‘Runtime’,‘Age’,‘Weight’ Donna,F,8.17,42,68.15 Gracie,F,8.63,38,81.87 Luanne,F,8.65,43,85.84 Mimi,F,8.92,50,70.87 Chris,M,8.95,49,81.42
12
Creating a SAS data set: The Data Step
DATA one; INFILE CARDS DLM=',' DSD MISSOVER; INPUT Name $ Gender $ Runtime Age Weight; DATALINES; Donna,F,8.17,42,68.15 Gracie,F,8.63,38,81.87 Luanne,F,8.65,43,85.84 Mimi,F,8.92,50,70.87 Chris,M,8.95,49,81.42 ; RUN; PROC PRINT DATA=one;
13
Data for this course
14
Data set from KKNR 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 10,154,56 …
15
Exercises Write a SAS program to read the data located in the “sbp.txt” text file.
16
SAS Procedures The reg.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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.