%corrdemo
-----------------------------------------------------------------------
Demo on Correlation Coefficient
Description
Shows scatterplot and correlation for a given data file.
Syntax
%corrdemo(corr= , size=, outfile=' ', data= , dev= ,
title= ,axis1=, axis2=, symbol=, plot=);
corr - draw a sample from a population with a correlation
of this size.
size - the sample size, how many pairs to draw
outfile - saves the graph as a .gif file with the given name
dev - specifies the device used for saving the graph, which
determines the size of the graph
title - the title displayed at the top of the graph
axis1 - options for the "axis1" statement (the x axis)
axis2 - options for the "axis2" statement (the y axis)
symbol - options for the "symbol" statement
plot - options for the "plot" statement
Examples
%corrdemo
%corrdemo(size=500, corr=0.9)
%corrdemo(size=500, corr=0.9, outfile="c:\temp\corr9.gif")
%corrdemo(size=500, corr=0.7, outfile="c:\temp\corr7.gif", symbol = i=r)
%corrdemo(size=200, corr=-0.70, outfile="c:\temp\whatcorr.gif",
title="What is the Correlation Coefficient?")
Author
Xiao Chen
Statistical Computing and Consulting
UCLA Academic Technology Services
Also See
Also see the web at
http://www.ats.ucla.edu/stat/sas/teach/corrrelation/corr.htm
Also see the macro itself from
http://www.ats.ucla.edu/stat/sas/macros/corrdemo.sas.txt