Introduction To Correlation with SAS
Document Sample


Introduction To Correlation
with SAS
Sam Gordji
ccsam@olemiss.edu
Weir 107
List of Statistical Packages
Available through OIT
• SPSS (Windows)
• SAS (Windows & Unix)
• Mathematica (Windows)
• Matlab (willow, 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
Correlation with SAS
• This seminar covers correlation with 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 including
procedure correlation
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. 2009)
• To obtain a copy of SAS please email
– assist@mcsr.olemiss.edu
Installation of SAS
• To obtain a DVD for SAS send an email
to:
– assist@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 */
data test; /* 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 */
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
Correlation
• Correlation coefficient measures the
relationship between two variables
• The correlation coefficient is always
between -1 and 1, -1.0<=C<=1.0
• Values near 0 are indication of no
relationship and values near 1 indicate a
strong relationship between the variables
• Negative values indicate negative
relationship
An Example of Correlation
corr748re.sas
• Below is an example of correlation analysis
• Data is entered into “Editor”
• Download corr748re.sas program below from:
http://www.mcsr.olemiss.edu/educationsubpage.php?pagename=jancamp09_inc
Output from Correlation
Analysis
Non-parametric Correlation
• Proc corr also performs non-
parametric correlation
• Proc corr below performs non-
parametric correlation and obtains
Spearman, Kendall Tau, and
Hoeffding correlation
Non-parametric Correlation
Non-parametric Correlation
Assumes That the Input Data Is Non-Parametric
Pearson
Spearman
Kendall Tau
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, 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
Related docs
Get documents about "