3

When a regression is calculated with a simple linear model that returns intercept and slope for an equation like this $y=a + bx$ one can predict $y$, the response variable, based on that equation.

Equally one could rearrange for $x$: $x=\frac{\left(y-a\right)}{b}$ and calculate the value of $x$. This isn't available in R's predict() function but can easily be done. Can one do this calculation and still be statistically sound?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
USER_1
  • 201
  • 3
  • 9
  • For monotonic prediction function, this should be straightforward. Non-monotonic functions do not necessarily have a single solution for x={y-a}/b. What do you mean by statistically sound? – Kees Mulder Nov 06 '14 at 15:25
  • 2
    This is common in analytical chemistry (where known values of the standards are used as x-values and the instrument response as y-values for calibration). Thus, package chemCal provides a function `inverse.predict`. I don't understand your last sentence. – Roland Nov 06 '14 at 15:26
  • By statistically sound I mean whether the prediction error of such transformed function is exactly the same as the original one. – USER_1 Nov 06 '14 at 15:27
  • 2
    No, you need to estimate the standard error of the inverse prediction. `chemCal::inverse.predict` does this. Look at the function's code. – Roland Nov 06 '14 at 15:30
  • Why not to apply the regression to x = c + dy ? – Łukasz Kidziński Nov 06 '14 at 16:08
  • @ŁukaszKidziński That's what I am doing now. But I do not have values of x for the prediction. As Roland said it's more of an analytical chemistry task where the y-values are meant to be used for calibration. – USER_1 Nov 06 '14 at 16:12
  • 4
    This is sometimes called "inverse regression", though unfortunately the recent rise of 'sliced inverse regression' makes the use of the term in relation to calibration-type applications rather harder to search for (`-sliced` helps). it looks like the `invest` function of the `investr` package in R does what you seek. – Glen_b Nov 06 '14 at 21:41
  • 4
    There is now a dedicated package called investr for this problem. https://cran.r-project.org/web/packages/investr/investr.pdf I get what you mean by "statistically sound", looking at the paper it doesn't seem a trivial problem to just invert the analysis. https://journal.r-project.org/archive/2014-1/greenwell-kabban.pdf – Andy74 Jan 27 '16 at 19:47

0 Answers0