Introduction to SAS Sam Gordji Weir 107

advertisement
Introduction to SAS
Sam Gordji
ccsam@olemiss.edu
Weir 107
List of Statistical Packages
Available through OIT
•
•
•
•
•
SPSS (Windows)
SAS (Windows & Unix)
Mathematica (Windows)
Matlab (Windows & Unix)
Free PGI Fortran compiler
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 Introduction to SAS
SAS is available in
– Weir Student Lab (4 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 $200 per copy per year (starting
Aug. 09)
To obtain a copy of SAS please email
– assist@mcsr.olemiss.edu
– ccsam@olemiss.edu
Installation of SAS
• To obtain a DVD for SAS send email to:
– assist@olemiss.edu
– ccsam@olemiss.edu
• The instruction for installation will be
emailed to you
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 for Faculty and
Students:
http://www.mcsr.olemiss.edu/mathematica/fall_sem/SASResources.ppt
SAS’ Three Main Files
•
•
•
•
*.sas (a SAS program file created by the
user, an input file)
*.log (a file created by SAS containing
the “log” after the user’s program is
finished running)
*.lst (a file containing the output)
Examples of the three SAS files
– my.sas
– my.log
– my.lst
Running SAS on Windows
Click on the “SAS” icon to activate SAS
Create your program (below) in a window named “Editor- Untiled1”
Blue Text is your program
/* comments go between slashes and stars */
/* every SAS program starts with “data” , test is a
given name for this program */
input a b c; /* variables are a, b, and c */
cards;
/* input data will follow “cards” */
123
/* variable a has 2 observations, 1 and 2 */
2 3 -1
/*variable b has 2 observations, 2 and 3, and so on */
;
/* semicolon signals the end of the data */
proc print; proc means;
/* proc print prints the data, proc means
obtains several statistics including the mean */
run;
/* run, runs the program */
data test;
Running SAS on Windows
User’s SAS Program
Click “run” and then “submit” the above example
Running SAS on Windows
listing file (output of SAS)
Input data:
Results:
Running SAS on Windows
SAS log file
first 3 lines of the user’s input
Lines 6 & 7 end data & proc print
Lines 7 & 8 proc means & run
An Example of Linear Regression
reg748re.sas
• Below is an example of regression analysis
• Data is entered into “Editor”
• Download reg748re.sas program below from:
http://www.mcsr.olemiss.edu/educationsubpage.php?pagename=jancamp09_inc
The Output from Linear Regression
Below shows the output of the Regression Analysis
The regression equation is y=8.8 +.439x
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
•
Go to
–
http://www.mcsr.olemiss.edu/educationsubpage.php?p
agename=jancamp09_sam.inc
download and run the following examples
– mort1.sas
– mem_corr.sas
Download