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?