2
$\begingroup$

I would like to understand how can I check if some points around a line have constant distance between the point and the line.

So image a normal chart(cartesian plane) with a line that is formed with points where its coordinates are: x > 0 and y > 0 so always numbers bigger then zero.

Then, when I have this line i need to check if the distances of a list of points(x,y) are constant. With "constant" I mean that the distance between the points and the line is similar. Example:

LINE: (x - y coordinates)

1 - 1
2 - 2
3 - 3
4 - 4
5 - 5
6 - 6

POINTS: (x - y coordinates)

1 - 1.1
2 - 1.9
3 - 2.9
4 - 4.2
5 - 5.1
6 - 5.8

How can I check if the difference between the point on the line and the point (of the list of points) are constant?

Thanks

$\endgroup$

1 Answer 1

5
$\begingroup$

Project the data orthogonally onto the line and inspect the residuals.

In this case, where the reference line is given (independently of the data) as $y=x$, the projection is tantamount to plotting the points $\{((x_i+y_i)/2, y_i-x_i)\}$. To illustrate, here are your points and the reference line:

xy plot

Here is the derived plot:

y-x vs y+x plot

You can now apply any test of homogeneity and independence of residuals you like, such as the Fligner-Killeen test or Breusch-Pagan test. (Many such tests assume the first coordinate is fixed, not random, so they will be only approximately correct, but in general--at least when the data aren't terribly noisy--they should work fine.)

$\endgroup$
9
  • $\begingroup$ thank you for your answer, I have one doubt. I'm reading how FLigner-Killeen works and I found: stat.ethz.ch/R-manual/R-patched/library/stats/html/… I have to pass a "group" at the second parameter, what does it mean? thank you! $\endgroup$
    – Dail
    Commented Sep 27, 2011 at 16:40
  • $\begingroup$ That's an interesting solution, but what are the alternatives that the BP test would have power against? I guess that you could test against a polynomial function of x, depending upon how many data points the OP has. I'm not familiar with the FK test that you mention. $\endgroup$
    – Charlie
    Commented Sep 27, 2011 at 16:42
  • $\begingroup$ @Charlie what do you mean with "you could test against a polynomial function of x" ? could you give me a simple example with R code? $\endgroup$
    – Dail
    Commented Sep 27, 2011 at 16:54
  • $\begingroup$ @Dail, you need to specify the form of the BP test. The test requires that you regress the residuals on something. It could be just a constant term (the coefficient on this term should be exactly 0 if the line in question is from OLS on the points) or include other variables as well. No variables besides x were mentioned in the question (taking y to be the outcome, so it doesn't count), so the only other things that you could include in the model are functions of x---I suggested polynomial functions. The BP test judges whether the coefficients on these terms are 0. $\endgroup$
    – Charlie
    Commented Sep 27, 2011 at 17:10
  • $\begingroup$ @Charlie, do you know how to calculate OLS regression with R? I didn't find it, at the moment i use lm() (linear regression), is not good? $\endgroup$
    – Dail
    Commented Sep 27, 2011 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.