# How can I refute a monotonic correlation

I have a binary target T and a continuous variable I expect to correlate with it. I expect some monotonic correlation, as the explaining variable increases I expect P(T) to increase. I collect some (independent) samples and I see in some binning what appears like a dip in the measured P(T), how can I test if this is a sampling fluke or if my monotonic assumption is likely false. I'm considering using isotonic regression to convert my explaining variable to a probability estimate, but I'm wondering when I should not do this, maybe pre-select bins and average in them and not assume montonicity. Essentially I would like to assume monotonicity unless the data tells me this very unlikely.

I would model this using logistic regression, and definitely not binning! I will denote the continuous variable by $$x$$. So then we use a logistic model for $$\DeclareMathOperator{\P}{\mathbb{P}} \P\left\{ Y=1 \mid X=x\right\} = \frac1{1+e^{-\eta(x)}}$$ where $$\eta(x)$$ is some linear predictor. The "usual" logistic regression is $$\eta(x)=\beta^T x$$ but you could also use a spline function. An interesting idea, giving a non-parametric fit, is to use a spline representation. To force a monotone solution, you could use a monotone spline, see Looking for function to fit sigmoid-like curve. Then such a model could be compared with a fit with regression splines, as in the answer by @Peter Flom (and with the problems he mentions, as this would be non-nested models.)