Could someone point me in the right direction?
Suppose we compare 2 treatments. For each patient we observe $(Y_i,R_i)$ where $Y_i$ denotes if the treatment was succesfull ($Y_i=1$) or not ($Y_i=0$), and $R_i$ denotes the treatment group 1 or 2. In treatmentgroup 1 the chance of a succesfull treatment is $p_1$, in group 2 $p_2$.
Let $\psi = p_1-p_2$. Find an maximum likelihood estimator for $\psi$.
My observations:
I guess I should find the maximum-likelihood estimator for both $p_1$ and $p_2$, combining them into $\hat \psi$.
I think $Y_i\mid R_i=1$ has the following pdf:
$$f_{Y_i\mid R_i = 1} (y_i\mid r_i=1) = \binom{\sum_i I(R_i=1)}{y_i} p_1^{y_i}(1-p_1)^{\sum_i I(R_i=1)-y_i}$$
But this looks very complicated... Is this right? How could I continue?
Solution should be $\hat \psi = \frac{\sum I(R_i=1)Y_i}{\sum I(R_i=1)}-\frac{\sum I(R_i=2)Y_i}{\sum I(R_i=2)}$