# Random variable variance

I have the model $y_i=\beta_1+\beta_2 X_i+ u_i$ where $u_i\sim\text{iid } N(0,\sigma^2)$. I estimate $\beta_1$ and $\beta_2$ by drawing a straight line between the first $(x_1,y_1)$ and last dot $(x_n,y_n)$. So, $\hat{\beta}_2$ will be the slope of this straight line.

What is the variance of $\hat{\beta}_2$ (the estimate of $\beta_2$)? Make a t-test of $H_0: \beta_2=0$. What is the 95 % confidence interval for $\beta_2$?

When I calculate the variance of $\hat{\beta}_2$, I get that it equals to 0. Can it really be 0? What happens with the t-test and confidence interval if the variance, and thus the standard error, is zero?

• Since this seems to be routine bookwork please add the self-study tag (remove one of your 5) and read its tag wiki info ... stats.stackexchange.com/tags/self-study/info ... modifying your question as needed. – Glen_b Aug 27 '14 at 20:58

The estimator for $\beta_2$ here is

$$\hat{\beta}_2 = \frac{y_n-y_1}{x_n-x_1}$$

The denominator is a constant. What is the distribution of $y_n$ and $y_1$? Use the following properties of variance to find $\text{Var}(\hat{\beta}_2)$:

If $c$ is a constant, $\text{Var}(cZ) =c^2\text{Var}(Z)$.

$\text{Var}(Z_1\pm Z_2)=\text{Var}(Z_1)+\text{Var}(Z_2) \pm 2\text{Cov}(Z_1,Z_2)$

($Z$, $Z_1$ and $Z_2$ are random variables)

Applying these rules, you will find that the variance is not zero.

• Thanks! @comp_warrior The distribution of yn and y1 is not known. So when I calculate the variance I get: Var(β̂ 2)=1/(xn-x1)^2* Var(yn-y1)= 1/(xn-x1)^2* Var(β1+β2Xn+un-(β1+β2X1+u1)= 1/(xn-x1)^2* Var(β2Xn+un-β2X1-u1) Which I get equals to 0 since Var(β2Xn)=Var(β2X1)=0 since both β2 and Xi are assumed to be constants. And since Var(un)=Var(u1) these last terms cancel each other out. Where do I get the calculations wrong? – Matilda Aug 27 '14 at 17:41
• @Matilda Are you sure the distributions of $y_n$ and $y_1$ are unknown? If $Z\sim N(\mu,\sigma^2)$, then $Z+a\sim N(a+\mu,\sigma^2)$. You can apply this property to both $y_n$ and $y_1$. – Comp_Warrior Aug 27 '14 at 18:06
• @Matilda In your calculation, you cannot cancel out $u_n$ and $u_1$ since they are random variable and not constants. Instead, use the identities I have posted above. – Comp_Warrior Aug 27 '14 at 18:08
• Yes, the information above is all information I have about yi. Aren't the variation of both un and u1 equal to σ2 according to ui∼iid N(0,σ2)? Wouldn't this imply that the terms Var(un)-Var(u1)=σ2-σ2=0 – Matilda Aug 27 '14 at 18:30
• @Matilda Consider the equation for $y_1$: $\beta_1+\beta_2x_1$ is a constant, and we know $u_i\sim N(0,\sigma^2)$. So $y_i\sim N(\beta_1+\beta_2 x_1,\sigma^2)$. You are right that $\text{Var}(u_1)=\text{Var}(u_2)=\sigma^2$. But $\text{Var}(u_n-u_1)\ne \text{Var}(u_n)-\text{Var}(u_1)$. See my answer for the correct expression. – Comp_Warrior Aug 27 '14 at 18:52