x <- c(1, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55, 0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05, 0)
y <- c(1, 1, 1, 1, 1, 0.98, 0.99, 0.9, 0.8, 0.66, 0.58, 0.34, 0.33, 0.22, 0.08, 0.19, 0.09, 0.09, 0.18, 0.08, 0.13)
x <- c(1, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55, 0.5, 0.45,
0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05, 0)
y <- c(1, 1, 1, 1, 1, 0.98, 0.99, 0.9, 0.8, 0.66, 0.58, 0.34, 0.33,
0.22, 0.08, 0.19, 0.09, 0.09, 0.18, 0.08, 0.13)
plot(x, y, ylim = c(0, 1), col = 'red')
abline(h = 0.1, lty = 2)
m <- glm(y ~ x, family = 'binomial')
p <- predict(m, newdata = data.frame(x = x), type = 'response')
lines(x, p, col = 'green')
plot(x, y, ylim = c(0, 1), col = 'red')
abline(h = 0.1, lty = 2)
m <- glm(y ~ x, family = 'binomial')
p <- predict(m, newdata = data.frame(x = x), type = 'response')
lines(x, p, col = 'green')
The line-of-best-fit should be more like the dotted black line, but I don't know how to estimate that.