Contents Up << >>

Linear regression and correlation coefficient

Format: R[egress] [g[raphfile]] [column column [column]]
Calculates the correlation coefficient between two measures in different columns, and calculates the linear regression line ("least squares fit") for the second column on the first.

Examples:

Enter command -  REG C15 C16

Enter command -  r
Enter two columns to compare (one on each line):
c15
c16
Output:

Linear regression using C15 (GHQ) and C16 (HDA)
Regression of c16 on c15: C16 = 4.788 + 0.208 * C15
Correlation coefficient r = 0.725
SE(b)= 0.020 Significance: t = 10.416, 98 df p = 0.0000
The correlation coefficient, r, is output (this is sometimes referred to as Pearson's correlation coefficient). The standard error of the gradient of the line SE(b) is output, and this can be taken to be distributed as a t statistic allowing the calculation of confidence limits. It is also used to calculate the significance of the results - the probability value quoted is a two-tailed value for a correlation of such magnitude to occur by chance.

If confidence limits have been requested (using the LIMITS command) then upper and lower confidence limits for the true correlation coefficient and gradient will also be output. The graphing option plots one variable against the other and allows the regression lines to be displayed (see the relevant section in the EASIGRAF documentation).

If a third column name is given then it will be filled with the values which would be predicted from the regression equation with the coefficients arrived at. These are the values which the dependent variable would take if it was completely determined by the independent variable according to the regression equation.

Example:

Enter command -  REG C15 C16 C17
This gives just the same as result as entering:

Enter command -  REG C15 C16 
Enter command -  DERIVE C17 4.788 + 0.208 * C15
The linear regression equation is automatically applied to column 15 and the results entered into column 17.