Estimating $\beta_o$ and $\beta_1$ with Weighted Least Squares with Logit link

158 Views Asked by At

I showed that $\hat\beta_0$ and $\hat\beta_1$ must satisfy:

$$\sum w_i\hat\beta_0+\sum w_ix_i\hat\beta_1=\sum w_iy_i$$ and $$\sum w_ix_i\hat\beta_0+\sum w_ix_i^2\hat\beta_1=\sum w_i x_i y_i$$

I need to fit a model where $r_i/n_i$ is the proportion dead at dose $d_i$. Let $x_i=\log d_i$,$1/w_i=\operatorname{Var}(Y_i)$ and $$p_i=\frac{r_i+1/2}{n_i+1}$$

I also showed that $\operatorname{logit}(p_i)$ has expectation $\operatorname{logit}(\theta_i)=\beta_0+\beta_1x_i$ and variance $\frac{1}{n\theta_i(1-\theta_i)}$ Approximated variance of $w_i=np_i(1-p_i)$

Now I need to estimate $\hat\beta_0$ and $\hat\beta_1$

My attempt:

What are the fitted values : $y_i$? They are $\operatorname{logit}(p_i)$, the observed proportions. Now I need to fit a least square line with axis $\operatorname{logit}(p_i)$ against $x_i$.

Rearranging the estimates I have:

$$\hat\beta_0=\frac{\sum w_iy_i-\sum w_ix_i\hat\beta_1}{\sum w_i}$$ and $$\hat\beta_1=\frac{\sum w_i x_i y_i-\sum w_ix_i\hat\beta_0}{\sum w_ix_i^2}$$

Now I don't know how to proceed, do I need to put summs inside summs or is there an easy way?

What will the plotted line be? Is it the expected proportion of deaths $Y$ given some dose best supported by our data?

EDIT:I know it's a horrible expression, but is it valid?

Can I simply say:

$$\hat\beta_1=\frac{\sum w_i x_i y_i-n\frac{\sum w_iy_i-\sum w_ix_i\hat\beta_1}{\sum w_i}\sum w_ix_i}{\sum w_ix_i^2}$$

Simplifying:

$$\hat\beta_1-n\frac{\sum w_ix_i \sum w_ix_i\hat\beta_1}{\sum w_i\sum w_ix_i^2} =\frac{\sum w_i x_i y_i-n\frac{\sum w_iy_i}{\sum w_i}\sum w_ix_i}{\sum w_ix_i^2}$$

And again: $$\hat\beta_1(1-n\frac{\sum w_ix_i \sum w_ix_i}{\sum w_i\sum w_ix_i^2}=\frac{\sum w_i x_i y_i-n\frac{\sum w_iy_i}{\sum w_i}\sum w_ix_i}{\sum w_ix_i^2}$$

1

There are 1 best solutions below

2
On BEST ANSWER

If $Y = X\beta+\epsilon,$ and $var(Y_i)=1/w_i$ and $cov(Y_i, Y_j)=0$, then $cov(Y)=\sigma^2 \times diag(1/w_1,...,1/w_n)$, as such the "correction" $V^{-1/2}$ matrix should be of the form $V^{-1/2}=diag(\sqrt{w_i},...,\sqrt{w_i})$ because now $$ cov(V^{-1/2}Y)=V^{-1/2}cov(Y)V^{-1/2}=\sigma^2 I. $$ Therefore, the WLS will be $$ \beta_{WLS} = (X'V^{-1}X)^{-1}X'V^{-1}y, $$ where $V^{-1} =diag(w_1,...,w_n)$ and $X$ is the usual design matrix of a form $X=[\mathbb{\vec{1}}, \mathbb{\vec{x}}]$. After some algebra you should get $$ \beta_{WLS} = \begin{pmatrix} \sum w_i & \sum x_iwi\\ \sum x_iw_i & \sum x_i^2w_i \end{pmatrix} \begin{pmatrix} \sum w_iy_i\\ \sum x_iw_iy_i \end{pmatrix}. $$ I guess you can compare it to your final result to reassure the calculations.