I have a dataset that defines a set of points on a two-dimensional Cartesian plane. Theoretically, these points should form a line, but this line can be perfectly horizontal, perfectly vertical and everything in between.
I would like to develop an algorithm that evaluates the βdirectnessβ of this line.
For example, the following datasets would be completely straightforward:
Y = 2/3x + 4
X | Y
---------
-3 | 2
0 | 4
3 | 6
Y = 4
X | Y
---------
1 | 4
2 | 4
3 | 4
X = -1
X | Y
---------
-1 | 7
-1 | 8
-1 | 9
Until this happens:
X | Y
---------
-3 | 2
0 | 5
3 | 6
I think this will work to minimize the sum of the squared distances of each point from line to line (usually called the regression line), and then determine the average distance of each point to the line. Thus, a perfectly straight line will have an average distance of 0.
, , . , .
Excel 2010 VBA, .
,
PaulH
, RSQ LinEst, , , . ( ), RSQ 0, .
-PaulH