MONT 106N -- Identifying Patterns 

The Correlation Coefficient and Its Geometric Meaning
October 21, 2009
 

 

Given a scatter plot, the correlation coefficient  r 

is a way to quantify how close the points (x, y) are to 

lying along a single straight line.  The coefficient
takes values in the range  `and`(`<=`(-1, r), `<=`(r, 1.))A value of
r = -1:  indicates that the points all
                             lie along a line of negative slope

                 
r = 0:    indicates no linear relationship at all

                 
r = +1:  indicates that the points all
                              lie along a line of positive slope

Values between 0 and 1 or between -1 and 0  indicate
 

the ``strength'' of the tendency toward a linear relation
between  
x  and  y.  Here are some illustrative examples:   randomize(); 1 

1256126173 (1)
 

`assign`(r1, `+`(`*`(`/`(1, 10000000), `*`(rand(1 .. 100000000))))); -1 

`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
`assign`(CloudPlot, proc (a, b, p) local xs, ys, i, theta, s, C; with(Statistics); `assign`(xs, []); `assign`(ys, []); for i to 1000 do `assign`(theta, evalf(`+`(`*`(2, `*`(Pi, `*`(r1())))))); `assign...
 

CloudPlot(5, 11, .9); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, .7); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, .5); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, .3); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, .1); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, -.1); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, -.3); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, -.5); 1 

 

Correlation coefficient is r =
Plot_2d
 

CloudPlot(5, 11, -4); 1 

 

Correlation coefficient is r =
Plot_2d