Are two simple independent causal samples from two distributions of bernoulli medium respectively:
$i=1,...,10$ $ π_1 = e^{B_1} / (1 + e^{B_1})$
$i=1,...,10$ $ π_2 = e^{B_1 + B_2} / (1 + e^{B_1 + B_2})$ $i=1,...,10$
a) Formulate an appropriate logistic regression model that models the expected value of $y_i$, ($i = 1, ..., 20$)
b) Write a log- likelihood function for B $ = ( B_1 , B_2 ) $
c) Having observed $\sum_{i=1}^{10} y_i = 3$ and $\sum_{i=11}^{20} y_i = 5$ find the maximum likelihood estimation
a)
$logit[π_1] = ln [ π_1 / 1 - π_1] = B_1$$logit[π_1] = ln [ π_1 / (1 - π_1)] = B_1$
$logit[π_2] = ln [ π_2/ 1 - π_2] = B_1 + B_2 $$logit[π_2] = ln [ π_2/ (1 - π_2)] = B_1 + B_2 $
b) $L_1 = π_1^{y_i} (1-π_1)^{1-y_i} = (e^{B_1} / (1 + e^{B_1}))^{y_i} (1 - (e^{B_1} / (1 + e^{B_1}))^{1-y_i} $
$L_2 = π_2^{y_i} (1-π_2)^{1-y_i} = (e^{B_1 + B_2} / (1 + e^{B_1}))^{y_i} (1 - (e^{B_1 + B_2} / (1 + e^{B_1 + B_2}))^{1-y_i} $
it's correct?