# Show difference between conditional expectations is positive

Suppose we have a continuous random variable $$Y$$ and a random Bernoulli variable $$T$$ such that $$P(T=1|Y)$$ is monotonically increasing in $$Y$$.

How can we show that $$E[Y|T=1]>E[Y|T=0]$$?

To me, it makes intuitive sense, but I can't prove it mathematically.

I've managed to answer the question myself. I'm including the solution here for other people that might have the same question.

I want to show that the quantity below is greater than $$0$$.

$$=E[Y \mid T = 1]-E[Y \mid T = 0]$$

$$=\int^{\infty}_{-\infty}{yP(Y=y \mid T=1)dy} -\int^{\infty}_{-\infty}{yP(Y=y \mid T=0)dy}$$

Let $$p = P(T=1)$$ and $$f$$ be the PDF of $$Y$$. Then:

$$=\int^{\infty}_{-\infty}{y\left(\frac{P(T=1 \mid Y=y)f(y)}{p}-\frac{(1-P(T=1 \mid Y=y))f(y)}{1-p}\right)dy}$$

$$=\int^{\infty}_{-\infty}{f(y)y\left(\frac{P(T=1 \mid Y=y) - p}{p(1-p)}\right)dy}$$

$$=\frac{1}{p(1-p)}(\int^{\infty}_{-\infty}{f(y)y P(T=1 \mid Y=y)dy} - p\int^{\infty}_{-\infty}{f(y)ydy})$$

Let $$Z=P(T=1 \mid Y)$$. Then:

$$=\frac{1}{p(1-p)}(E[YZ] - E[Z]E[Y])$$

$$=\frac{1}{p(1-p)}Cov(Y,Z)$$

We know that $$Z$$ is increasing in $$Y$$, and the covariance of a random variable and an increasing function of that random variable is always positive (see reference). Therefore:

$$=E[Y \mid T = 1]>E[Y \mid T = 0]$$