R's lm(), get x when y is known [duplicate]

Here is some data and a logarithmic model:

df <- data.frame(
x = 1:8,
y = c(7.5,6,5.2,4.3,3.9,3.4,3.1,2.9)
)

model <- lm(y ~ log(x), data = df)


I am able to use this model to predict y for any given x e.g.

predict(model, newdata = data.frame(x = 10)) # 2.3


My question is, if I want to find y when x is known, can I do that? 'Reverse prediction' or what's the correct term?

e.g. If I want to know the value of x when the function output is 8, how would I do that?

• I'm assuming that whoever closed this pasted the wrong duplicate link, because I don't see how that linked post answers the question. Apr 9 '21 at 17:23
• This is called calibration or inverse-prediction Apr 9 '21 at 21:19

Coefficients:
(Intercept)       log(x)
7.544       -2.268


In original

$$y=7.544-2.268 \cdot \log(x)$$

therefore

$$(7.544 - y)/2.268 = \log(x)$$

or

$$\exp((7.544 - y)/2.268) = x$$

I don't have enough reputation to comment, but I've heard it referred to as calibration or inverse regression. Hope that gives you something to start.

• Thanks for the info @PRZ! Apr 9 '21 at 11:41