Solved – Residual variance formulas difference

residualsvariance

There is a bi-dimensional table of frequencies:

freq table

Doing the regression analysis with the fit formula being $\hat y=a+bx^2$, where $\hat y$ is the same as $y^{est}$, the filled table looks like this:
calculated table of regression analysis

Doing standard regression analysis (i.e. by calculator) and substituting calculated $a$ and $b$ yields linear fit formula $\hat y_i=0.1077+1.4154x^2$.

I need to calculate the residual variance. I have encountered two formulas for calculating, I residual variance in the statistics course presentations, I am currently taking:

$$V_r=\frac{\sum_i n_ie_i^2}{\sum_i n_i} – \left(\frac{\sum_i n_ix_i}{\sum_i n_i}\right)^2$$
$$V_r=\frac{\sum_i e_i^2}n – \left(\frac{\sum_i e_i}n\right)^2$$

They both give different results (1.5282 vs 2.6219). There is a also question concerning this, that has got a exhaustive answer and the formula there for residual variance is:

$$\text{Var}(e^0) = \sigma^2\cdot \left(1 + \frac 1n + \frac {(x^0-\bar x)^2}{S_{xx}}\right)$$

But it looks like a some different formula. I would like to use it to verify the results. I have found that $S_{xx}=\sum_i (x_i-\bar x)^2$, but I still do not understand what the $e^0$ and $x^0$ represents.

There are also multiple formulas on the internet for calculating residual variance, that are completely different and make me more confused. How do I compute residual variance from the given data?

Thank you for any help!

Best Answer

So, I have found the answer. It is not this (first formula in the question): $$V_r=\frac{\sum_i n_ie_i^2}{\sum_i n_i} - \left(\frac{\sum_i n_ix_i}{\sum_i n_i}\right)^2$$

But this (somehow, the $e_i$ got replaced by $x_i$ in the presentation):

$$V_r=\frac{\sum_i n_ie_i^2}{\sum_i n_i} - \left(\frac{\sum_i n_ie_i}{\sum_i n_i}\right)^2$$

The second formula from the question is the same, but used when the frequency is not specified (no cross-table, just independent and dependent variable).

The solution wasn't that hard as the moderators in the comments were continuously stating!

Related Question