Linear Regression

Display the field names for each column of data in the dataset. Assumes the dataset has fields separated by tabs, with linefeeds at the end of each line of text. This format for data is used by all EZ-R Stats procedures. Performs a linear regression analysis to determine of their is a linear relationship between two variables. Values can range from -1 (inverse relationship), 0 - no relationship to 1 (perfect correlation). This enables the analyst to quantify the extent there is a relationship between two variables.

Example screen shot:

Syntax

proc lr data=DATAFILE;
var VARIABLENAME;
out = OUTPUTRESULT;

Parameters Used

There are three parameters for the Linear Regression procedure:

DATAFILE - the datafile to be analyzed
VARIABLENAME - the numeric variable to be analyzed
OUTPUTRESULT - name of the file to store the results of the analysis

Example Script

*;
*;
* lr1.ezs;
* test of linear regression procedure;
* determine if correlation between various columns in the census;
libname test '{%libout}';
libname in '{%libin}';
proc lr data=in.censuspart1;
out = test.lr1a;
var v0031990 v0051990;
run;
proc lr data=in.censuspart1;
out = test.lr1b;
var v0032000 v0052000;
run;
proc lr data=in.censuspart1;
out = test.lr1c;
var v0011990 v0012000;
run;

Example Output

Output from the procedure is a matrix which shows the correlation values between the variables specified. This matrix may be viewed using either MS-Excel or Word Pad.

What the data tells us

By looking at the values for the coefficient of correlation, we see that there is a strong correlation only between the last of the pairs of values tested. These values were the total population in 1990 versus the total population in 2000. One would expect that there is a strong correlation unless there is a lot of population movement between areas.

 

There is also a web analytics version which can be run directly from the Internet using Excel or other data source (in tab separated value format). View Web Analytics details. All software is provided at no cost.

Web Page last updated on 02-09-2007
© EZ-R Stats, LLC 2005-2007

© EZ_R Stats

Visit EZ_R Stats on the web at:

www.ezrstats.com