3
$\begingroup$

I have a set of three measurements $(x_i, y_i)$ where the x-values are equally spaced. I am interested in extracting the linear slope between these three points (while the intercept has no physical meaning, as there is an unknown offset).

Nevertheless, a least-squares linear fit of these three points would result in the slope being computed simply as $m = \frac{y_3-y_1}{x_3-x_1}$ because $x_2 = \bar{x}$.

Is there any method that include the information from $x_2$ in the computation of the slope?

$\endgroup$
5
  • 1
    $\begingroup$ Do you care about estimating the uncertainty in the slope? Because that cannot be done with 2 points, but can (albeit poorly) with 3. $\endgroup$
    – mkt
    Commented Jul 12, 2019 at 8:13
  • $\begingroup$ @user2974951 I'm afraid that is not right, if you have an odd number of equally spaced points, all of them will be in the slope computation except the central one $\endgroup$
    – broc
    Commented Jul 12, 2019 at 8:24
  • $\begingroup$ @mkt I guess that could be the only extra information the third point could give? $\endgroup$
    – broc
    Commented Jul 12, 2019 at 8:24
  • $\begingroup$ @broc Not sure, but I think so. $\endgroup$
    – mkt
    Commented Jul 12, 2019 at 8:27
  • $\begingroup$ Upon standardizing the $x_i$ and scaling the $y_i$ to unit variance, you can estimate an intercept $(y_1+y_2+y_3)/3,$ a slope $(y_3-y_1)/2,$ and a quadratic term proportional to $(y_1-2y_2+y_3)/6.$ This reveals how the middle response $y_2$ provides information about the intercept and the nonlinearity, but not about the slope at all. Another way to analyze the situation is to note that $y_2$ makes a major contribution to the residuals, which are all proportional to $y_1-2y_2+y_3.$ $\endgroup$
    – whuber
    Commented Jul 16, 2019 at 12:59

1 Answer 1

2
$\begingroup$

If your only goal is to somehow let $x_2$ matter, you could run a regression on $x$ and $x^2$, like in

x <- 1:3
y <- rnorm(3)
summary(lm(y~x))
summary(lm(y[c(1,3)]~x[c(1,3)]))
summary(lm(y~poly(x,2, raw=T)))

I am not suggesting this is a good idea from a subject-matter or specification point of view, though.

As regards the comments, $x_2$ does indeed matter for assessing uncertainty, as, in a simple regression (when assuming heteroskedasticity) $$ Var(m)=\frac{\hat\sigma^2}{\sum_i(x_i-\bar{x})^2} $$ So, while $x_2-\bar{x}$ again drops out in the denominator of $Var(m)$, the error variance estimator $\hat\sigma^2$ will generally (i.e., unless $y_2$ is also equal to its sample mean) receive a contribution from the residual $$ y_2-\hat{y}_2=y_2-\bar{y}, $$ where the equality sign is, e.g., explained here.

$\endgroup$

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.