Linear assumption for logistic regression I wanted to ask regarding the linearity assumption of the logistic regression, is the assumption between
A) independent variable (e.g. pre-score) vs logit of the outcome?
or B) predictive probability of the independent variable vs logit of the outcome?
Below is my R code regarding this problem. Any feedback on whether I wrote the code correctly or not and whether I should go with plot A or plot B is much appreciated.
fit <- glm(disease ~ Pre.score, data = final, family = binomial)
summary(fit)
pred.val.1 <- predict(fit, type ="response")
logit <- log(pred.val.1/(1-pred.val.1))

plot(logit,final$Pre.score) ## Plot for Point A
plot(logit,pred.val.1) ## Plot for Point B 

Plot for Point A

Plot for Point B


One way to write the data generating mechanism for logistic regression is as follows
$$ \mbox{logit}(p) = X\beta $$
$$ y \sim \mbox{Binomial}(n , p) $$
From this formulation, we find that the linearity assumption is made on the log odds scale.  So were we to plot the log odds of the outcome versus the predictor, we would see a straight line$^{1.}$

$^{1.}$ This isn't strictly true.  The assumption of linearity is not about the conditional mean, its about how we combine predictors.  I could easily make a non-linear curve using linear combinations of non-linear functions.  That being said, this all happens on the log odds scale.
