You can solve for mpg directly as follows:
mpg = (log(p/(1-p)) - coef(model)[1])/coef(model)[2]
Detailed explanation:
When you approach the regression model, you should consider the following equation:
log(p/(1-p)) = a + b*mpg
Where p is the probability that vs = 1, a is the interception, and b is the coefficient at mpg . From the results of model matching (just enter model or summary(model) ), we see that a = -8.8331 and b = 0.4304. We want to find mpg when p = 0.5. So, we need to solve the following equation:
log(0.5/(1-0.5)) = -8.331 + 0.4304*mpg log(1) = 0 = -8.331 + 0.4303*mpg
Reordering
mpg = 8.8331/0.4304 = 20.523
In general, to solve mpg for any p value:
mpg = (log(p/(1-p)) + 8.8331)/0.4304
Or, to make it more easily reproducible:
mpg = (log(p/(1-p)) - coef(model)[1])/coef(model)[2]
source share