nonparametric statistics using sas. 2 list the components of a sas program. open an existing sas...

Post on 21-Dec-2015

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

NonParametric Statistics using SAS

2

List the components of a SAS program. Open an existing SAS program and run it.

Objectives

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

5

Interactive windows enable you to interface with SAS.

SAS Windowing Environment

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

Learn the two fundamental SAS syntax programming rules.

Write a Data Step to read a 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

Veneer Data

brand wear Acme 2.3Acme 2.1Acme 2.4Acme 2.5Acme 2.2Acme 2.0Champ 2.2Champ 2.3Champ 2.4…

12

Write a SAS program to read the data located in the “veneer.txt“ text file.

Exercises

Nonparametric ANOVA

ObjectivesRecognize when nonparametric analysis

is appropriate.

Perform nonparametric analysis with the NPAR1WAY procedure.

Nonparametric AnalysisNonparametric analyses are those that rely only on the assumption that the observations are independent.

•Normality not required•Variances do not have to be equal•Small sample sizes ok•Dependant variable can be ordinal

Hypotheses of Interest

H0:all populationsare identical

H1:all populations are

not identical.

Rank Scores

Treatm ent Response

RankScore

A A A A A 2 5 7 8 10

SUM SUM

19 36

Median Scores

Treatm ent

Response

M edianScore

A A A A A 2 5 7 8 10

SUM SUM

1 4

Median = 8.5 Median = 8.5

THE NPAR1WAY PROCEDURE

PROC NPAR1WAY DATA=SAS-data-set <options>;CLASS variable;VAR variables;

RUN;

Veneer Data

brand wear Acme 2.3Acme 2.1Acme 2.4Acme 2.5Acme 2.2Acme 2.0Champ 2.2Champ 2.3Champ 2.4…

Veneer ExampleAre there differences between the durability of brands of wood veneer?

22

The nonparm.sas program contains several of the most common SAS procedures used your class.

During the remainder of this class, we will open that SAS program discuss the function of each of the procedures and demo it in SAS.

SAS Procedures

top related