Presentation is loading. Please wait.

Presentation is loading. Please wait.

Categorical Data Analysis using SAS. 2 List the components of a SAS program. Open an existing SAS program and run it. Discuss the Chi Square Test of Independence.

Similar presentations


Presentation on theme: "Categorical Data Analysis using SAS. 2 List the components of a SAS program. Open an existing SAS program and run it. Discuss the Chi Square Test of Independence."— Presentation transcript:

1 Categorical Data Analysis using SAS

2 2 List the components of a SAS program. Open an existing SAS program and run it. Discuss the Chi Square Test of Independence Objectives

3 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. Raw Data DATA Step Report SAS Data Set PROC Step SAS Programs

4 4 DATA one; 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; RUN; PROC REG DATA=one; MODEL Runtime=Weight; RUN; DATA Step PROC Steps SAS Programs

5 5 Interactive windows enable you to interface with SAS. SAS Windowing Environment

6 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 Exercises

7 7 Learn the two fundamental SAS syntax programming rules. Write a Data Step to read a course data file. Objectives

8 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

9 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

10 DATA one; 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; RUN; Creating a SAS data set: The Data Step

11 Typical Dataset Degree Age Gender Salary 0 41 Female Low 1 41 Female Low 1 44 Female Low 0 39 Female Low 0 40 Female Medium 1 37 Female Medium 0 38 Female Medium 0 35 Female High 0 36 Female High …

12 12 Write a SAS program to read the data located in the “salary.txt” text file. Exercises

13 Categorical Data Analysis ChiSQ Test of Independence

14 14 The chisq.sas program contains several examples of using SAS to create and analyze contingency tables. During the remainder of this class, we will open that program discuss the function of each of the procedures and demo it in SAS. SAS Procedures


Download ppt "Categorical Data Analysis using SAS. 2 List the components of a SAS program. Open an existing SAS program and run it. Discuss the Chi Square Test of Independence."

Similar presentations


Ads by Google