ppt

advertisement

Introduction to Linear

Regression with SAS

Sam Gordji ccsam@olemiss.edu

Weir 107

List of Statistical Packages

• SPSS

• SAS

• Mathematica

• Matlab

• IMSL

General Information

• IT staff will assist users

– To access these packages

– To find the proper procedure to analyze their data

• For assistance please email

– assist@mcsr.olemiss.edu

– ccsam@olemiss.edu

SAS/PC Statistical Package

• This seminar covers SAS & SAS/Regression

• SAS is available in

– Weir Student Lab (5 PCs)

– Weir 107

– Several other labs around campus

• SAS is also installed on willow (Unix server)

• SAS performs statistical analysis

Statistical Package:

SAS/PC (cont.)

• 50 copies are available for faculty use

• For each copy purchased, a faculty member can get a free copy (to be installed on a student PC)

• The cost is $100 per copy per year

• To obtain a copy of SAS please email

– ccsam@olemiss.edu

– assist@mcsr.olemiss.edu

Links for SAS

• The main webpage

– http://www.sas.com/

• For information on documentation for SAS visit

– http://support.sas.com/onlinedoc/913/docMainpage.jsp

• SAS Resources: http://www.mcsr.olemiss.edu/mathematica/fall_sem/SASRe sources.ppt

Examples of Regression

Analysis

• Looking at several examples

• Creating a simple SAS program and obtaining

– *.log

– *.lst (listing)

• Examples of simple regression with SAS

– reg748re.sas

– regcampB3.sas

– reg.sas

– regschaum.sas

Activating and Running SAS on

Windows

Click on the “SAS” icon to activate SAS

Enter the just the blue text in the Editor window data test; /* The name of the program */ input a b c; cards;

1 2 3

2 3 -1

/* Variables are a, b, and c */

/* Input will follow “card” */

; /* end of data */ proc print; proc means; run; /* run procedures print & means */

Running SAS on Windows

Click “run” and then “submit” the above example

Running SAS on Windows (Cont.)

Results will appear in the “output” window

Running SAS on Windows (Cont.)

Above shows the log file

Accessing SAS on willow

• Willow is Unix server housed in the data center building

• Willow’s operating system is Sun Solaris

(Solaris 10)

• Willow is the primarily used by researchers that have large number crunching programs

• Limited knowledge of Unix system is needed to run SAS

A Few Useful Unix Commands

• cat --- for displaying a file

• cd --- change directory

• cd 1--- to move to sub-directory 1 & so on

• cp --- for copying files

• ls --- see what files you have

• pwd --- find out what directory you are in

• rm --- remove a file

• pico --- a Unix editor

• sas --- to activate and run SAS programs

• To attend a Unix seminar, please contact assist@mcsr.olemiss.edu

Accessing SAS on Willow

SAS on willow may be accessed from the network.

Steps to access willow from a Windows PC:

– Request a willow account from the IT Helpdesk.

– Download/Install SSH Secure Shell Client from http://www.mcsr.olemiss.edu/appssubpage.php?pagename=ssh2.inc

– Click “Secure Shell Client”

Accessing SAS on Willow (Cont.)

Click “Quick Connect”

Accessing SAS on Willow (Cont.)

• For this workshop, everyone can login as student

• Fill in “Host Name” and “User Name” as above

• Click “Connect”

Accessing SAS on Willow (Cont.)

• Enter your password

• Click “OK”

Accessing SAS on Willow (Cont.)

Running SAS on Willow

• Willow is ready to execute SAS jobs

– cd to the numbered directory assigned to you, e.g. cd 5

– pwd to print working directory

– ls to list files in working directory

– To view a program, enter: cat file-name.sas

– To launch a SAS program, enter: sas file-name.sas

– To view the output of a program, enter cat file-name.lst

– Note that lst stands for listing

A Short SAS Program: test99.sas

• To view your input, enter cat test99.sas

• To run your SAS job enter sas test99.sas

Running SAS jobs

• To view your output, enter cat test99.lst

A Linear Regression Window/SAS reg748re.sas

• Below is an example of regression analysis

• Data is entered into “Editor”

The output from Linear Regression

Below shows the output of the Regression Analysis

Some SAS Proc

• Proc (Procedure)

– proc means (obtains mean, standard deviation)

– proc anova (performs simple AOV)

– proc plot (plots)

– proc lp (performs Linear Programming)

– proc reg ( performs regression)

– proc corr (performs correlation)

Questions

• Email contact

– Email your questions to assist@olemiss.edu

• To look at this presentation and other materials visit, click Computing Camp at www.mcsr.olemiss.edu

• Please fill out the feedback form and leave your email address so we may contact you for follow up questions

For Further Practice

On willow

• Execute the four examples in your path and look at

*.log and *.lst files

On PC

• From http://www.mcsr.olemiss.edu/educationsubpage.php?pagen

ame=augcamp08.inc

download and run the following examples

– reg748re.sas

– regcampB3.sas

– regschaum.sas

Download