Recent questions in Residuals

High school statisticsAnswered question

Davirnoilc 2022-11-17

Show explicitly that the following identity holds under a Simple Linear Regression:

$\text{}\sum _{i=1}^{n}{r}_{i}\hat{{\mu}_{i}}=0$

with residuals ${r}_{i}={y}_{i}-\hat{{\mu}_{i}}$ and $\hat{{\mu}_{i}}=\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i}$.

my steps:

$\begin{array}{rl}& \sum _{i=1}^{n}{r}_{i}\hat{{\mu}_{i}}\\ =& \sum _{i=1}^{n}({y}_{i}-\hat{{\mu}_{i}})(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}({y}_{i}-\hat{{\beta}_{0}}-\hat{{\beta}_{1}}{x}_{i})(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}{y}_{i}+\hat{{\beta}_{1}}{x}_{i}{y}_{i}-{\hat{{\beta}_{0}}}^{2}-\hat{{\beta}_{0}}\hat{{\beta}_{1}}{x}_{i}-\hat{{\beta}_{0}}\hat{{\beta}_{1}}{x}_{i}-{\hat{{\beta}_{1}}}^{2}{{x}_{i}}^{2})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}{y}_{i}+\hat{{\beta}_{1}}{x}_{i}{y}_{i}-{(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})}^{2})\\ =& \text{}\sum _{i=1}^{n}({y}_{i}(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})-{(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})}^{2})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})({y}_{i}-\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}\hat{{\mu}_{i}}{r}_{i}\\ & \end{array}$

how to proceed?

$\text{}\sum _{i=1}^{n}{r}_{i}\hat{{\mu}_{i}}=0$

with residuals ${r}_{i}={y}_{i}-\hat{{\mu}_{i}}$ and $\hat{{\mu}_{i}}=\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i}$.

my steps:

$\begin{array}{rl}& \sum _{i=1}^{n}{r}_{i}\hat{{\mu}_{i}}\\ =& \sum _{i=1}^{n}({y}_{i}-\hat{{\mu}_{i}})(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}({y}_{i}-\hat{{\beta}_{0}}-\hat{{\beta}_{1}}{x}_{i})(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}{y}_{i}+\hat{{\beta}_{1}}{x}_{i}{y}_{i}-{\hat{{\beta}_{0}}}^{2}-\hat{{\beta}_{0}}\hat{{\beta}_{1}}{x}_{i}-\hat{{\beta}_{0}}\hat{{\beta}_{1}}{x}_{i}-{\hat{{\beta}_{1}}}^{2}{{x}_{i}}^{2})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}{y}_{i}+\hat{{\beta}_{1}}{x}_{i}{y}_{i}-{(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})}^{2})\\ =& \text{}\sum _{i=1}^{n}({y}_{i}(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})-{(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})}^{2})\\ =& \text{}\sum _{i=1}^{n}(\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})({y}_{i}-\hat{{\beta}_{0}}+\hat{{\beta}_{1}}{x}_{i})\\ =& \text{}\sum _{i=1}^{n}\hat{{\mu}_{i}}{r}_{i}\\ & \end{array}$

how to proceed?

High school statisticsAnswered question

linnibell17591 2022-11-14

Show that $\hat{e}$ and $\hat{\beta}$, the residuals and coefficient vector for the OLS problem $y=X\beta +\u03f5$, are uncorrelated.

High school statisticsAnswered question

Celeste Barajas 2022-11-04

Having run a regression I check the estimated kernel density of the residuals. They appear nearly normal.

What can I conclude based on this? Can I say that my regression is 'good' in some sense as a result?

What can I conclude based on this? Can I say that my regression is 'good' in some sense as a result?

High school statisticsAnswered question

Aryanna Fisher 2022-11-02

Why the residuals do not sum to 0 when we don't have the intercept in simple linear regression?

High school statisticsAnswered question

4enevi 2022-10-28

How can to prove the variance of residuals in simple linear regression?

$\mathrm{var}({r}_{i})={\sigma}^{2}[1-\frac{1}{n}-{\displaystyle \frac{({x}_{i}-\overline{x}{)}^{2}}{\sum _{l=1}^{n}({x}_{l}-\overline{x})}}]$

my try:

using

${r}_{i}={y}_{i}-\hat{{y}_{i}}$

$\mathrm{var}({r}_{i})=\mathrm{var}({y}_{i}-\hat{{y}_{i}})=\mathrm{var}({y}_{i}-\overline{y})+\mathrm{var}(\hat{{\beta}_{1}}({x}_{i}-\overline{x}))-2\mathrm{Cov}(({y}_{i}-\overline{y}),\hat{{\beta}_{1}}({x}_{i}-\overline{x}))$

How can I go further?

$\mathrm{var}({r}_{i})={\sigma}^{2}[1-\frac{1}{n}-{\displaystyle \frac{({x}_{i}-\overline{x}{)}^{2}}{\sum _{l=1}^{n}({x}_{l}-\overline{x})}}]$

my try:

using

${r}_{i}={y}_{i}-\hat{{y}_{i}}$

$\mathrm{var}({r}_{i})=\mathrm{var}({y}_{i}-\hat{{y}_{i}})=\mathrm{var}({y}_{i}-\overline{y})+\mathrm{var}(\hat{{\beta}_{1}}({x}_{i}-\overline{x}))-2\mathrm{Cov}(({y}_{i}-\overline{y}),\hat{{\beta}_{1}}({x}_{i}-\overline{x}))$

How can I go further?

High school statisticsAnswered question

Rubi Garner 2022-10-21

Compute using residuals the integral of the following function over the positively oriented circle $|z|=3$

$f\text{}(z)={\displaystyle \frac{{e}^{-z}}{{z}^{2}}}$

My solution: The only singular point of $f$ in $\left|z\right|\le 3$ is $z=0$ (double pole) and its remainder is therefore

${\mathrm{Res}}_{z=0}f(z)={\displaystyle \underset{z\to 0}{lim}{\displaystyle \frac{1}{(2-1)!}{\left({\displaystyle \frac{{e}^{-z}{z}^{2}}{{z}^{2}}}\right)}^{\mathrm{\prime}}={\displaystyle \underset{z\to 0}{lim}-{e}^{-z}=-1}}}$

Consequently, ${\int}_{|z=3|}f(z)=2\pi i{\mathrm{Res}}_{z=0}f(z)=-2\pi i.$

this right?

$f\text{}(z)={\displaystyle \frac{{e}^{-z}}{{z}^{2}}}$

My solution: The only singular point of $f$ in $\left|z\right|\le 3$ is $z=0$ (double pole) and its remainder is therefore

${\mathrm{Res}}_{z=0}f(z)={\displaystyle \underset{z\to 0}{lim}{\displaystyle \frac{1}{(2-1)!}{\left({\displaystyle \frac{{e}^{-z}{z}^{2}}{{z}^{2}}}\right)}^{\mathrm{\prime}}={\displaystyle \underset{z\to 0}{lim}-{e}^{-z}=-1}}}$

Consequently, ${\int}_{|z=3|}f(z)=2\pi i{\mathrm{Res}}_{z=0}f(z)=-2\pi i.$

this right?

High school statisticsAnswered question

Angel Kline 2022-10-16

In a linear model, we defined residuals as:

$e=y-\hat{y}=(I-H)y$ where $H$ is the hat matrix $X({X}^{T}X{)}^{-1}{X}^{T}$

and we defined standardized residuals as:

${r}_{i}=\frac{{e}_{i}}{s\sqrt{1-{h}_{ii}}}$, $i=1,...,n$

where ${s}^{2}$ is the usual estimate of ${\sigma}^{2}$, $var({e}_{i})={\sigma}^{2}{h}_{ii}$, and ${h}_{ii}$ is the diagonal entry of $H$ at the ${i}^{th}$ row and ${i}^{th}$ column

Why ${r}_{i}$ and ${e}_{i}$ are functions of ${h}_{ii}$ rather than the whole row ${h}_{i}$?

$e=y-\hat{y}=(I-H)y$ where $H$ is the hat matrix $X({X}^{T}X{)}^{-1}{X}^{T}$

and we defined standardized residuals as:

${r}_{i}=\frac{{e}_{i}}{s\sqrt{1-{h}_{ii}}}$, $i=1,...,n$

where ${s}^{2}$ is the usual estimate of ${\sigma}^{2}$, $var({e}_{i})={\sigma}^{2}{h}_{ii}$, and ${h}_{ii}$ is the diagonal entry of $H$ at the ${i}^{th}$ row and ${i}^{th}$ column

Why ${r}_{i}$ and ${e}_{i}$ are functions of ${h}_{ii}$ rather than the whole row ${h}_{i}$?

High school statisticsAnswered question

priscillianaw1 2022-10-08

Given a set of data with $11$ observations of two variables (response and predictor), I've been asked to "calculate the fitted values ${\hat{y}}_{i}=\hat{\alpha}+\hat{\beta}{x}_{i}^{\prime}$ and residuals ${e}_{i}={y}_{i}-{\hat{y}}_{i}$ by hand".

What is the question asking me to do here? I have thus far estimated the regression line for the data in the form ${\hat{y}}_{i}=\hat{\alpha}+\hat{\beta}{x}_{i}^{\prime}$ by calculating the coefficients $\alpha \text{}\mathrm{}\text{}\beta ,,\; but\; this\; doesn\text{'}t\; answer\; the\; original\; question\; alone.\; Where\; do\; I\; go\; from\; here?$

What is the question asking me to do here? I have thus far estimated the regression line for the data in the form ${\hat{y}}_{i}=\hat{\alpha}+\hat{\beta}{x}_{i}^{\prime}$ by calculating the coefficients $\alpha \text{}\mathrm{}\text{}\beta ,,\; but\; this\; doesn\text{'}t\; answer\; the\; original\; question\; alone.\; Where\; do\; I\; go\; from\; here?$

High school statisticsAnswered question

Sluisu4 2022-09-30

Statistics (Regression Analysis): Show that the residuals from a linear regression model can be expressed as $\mathbf{e}=(\mathbf{I}-\mathbf{H})\u03f5$

The bold represents vectors or matrices.

I know that $\mathbf{e}=\mathbf{y}-\mathbf{H}\mathbf{y}$

So I tried expanding this to,

$\mathbf{e}=\mathbf{X}\beta +\u03f5-\mathbf{H}\mathbf{X}\beta \mathbf{-}\mathbf{H}\u03f5$

At this point I can see how to derive the more traditional,

$\mathbf{e}\mathbf{=}\mathbf{(}\mathbf{I}\mathbf{-}\mathbf{H}\mathbf{)}\mathbf{y}$

how to solve the original problem?

The bold represents vectors or matrices.

I know that $\mathbf{e}=\mathbf{y}-\mathbf{H}\mathbf{y}$

So I tried expanding this to,

$\mathbf{e}=\mathbf{X}\beta +\u03f5-\mathbf{H}\mathbf{X}\beta \mathbf{-}\mathbf{H}\u03f5$

At this point I can see how to derive the more traditional,

$\mathbf{e}\mathbf{=}\mathbf{(}\mathbf{I}\mathbf{-}\mathbf{H}\mathbf{)}\mathbf{y}$

how to solve the original problem?

High school statisticsAnswered question

Zack Chase 2022-09-24

Suppose there is a Quadratic relationship between a predictor, which exhibits a trend over time, and the response but we included only a linear term for that predictor in the linear regression model. Which of the following will happen if we use linear model for this regression model?

Will the diagnostics show autocorrelation in the residuals?

Do you think the residuals will add up to 0?

Will the diagnostics show autocorrelation in the residuals?

Do you think the residuals will add up to 0?

High school statisticsAnswered question

Makaila Simon 2022-09-24

Finding singularities and residuals

Let $f(z)=\frac{1}{(z-1)(2z-1)}$. Then

$f(z)=\frac{1}{z-1}-\frac{2}{2z-1}=-\sum _{k=0}^{\mathrm{\infty}}{z}^{k}-\frac{1}{z(1-\frac{1}{2z})}$

$=-(1+z+{z}^{2}+{z}^{3}+\cdots +{z}^{k}+\dots )-\frac{1}{z}\ast (1+\frac{1}{2z}+\frac{1}{(2z{)}^{2}}+\cdots +\frac{1}{(2z{)}^{k}}+\dots )$

$=-(1+z+{z}^{2}+{z}^{3}+\cdots +{z}^{k}+\dots )-\frac{1}{z}\ast (1+\frac{1}{2z}+\frac{1}{(2z{)}^{2}}+\cdots +\frac{1}{(2z{)}^{k}}+\dots )$

Therefore, the origin is an essential singularity of $f(z)$ with residue $-1$.

Let $f(z)=\frac{1}{(z-1)(2z-1)}$. Then

$f(z)=\frac{1}{z-1}-\frac{2}{2z-1}=-\sum _{k=0}^{\mathrm{\infty}}{z}^{k}-\frac{1}{z(1-\frac{1}{2z})}$

$=-(1+z+{z}^{2}+{z}^{3}+\cdots +{z}^{k}+\dots )-\frac{1}{z}\ast (1+\frac{1}{2z}+\frac{1}{(2z{)}^{2}}+\cdots +\frac{1}{(2z{)}^{k}}+\dots )$

$=-(1+z+{z}^{2}+{z}^{3}+\cdots +{z}^{k}+\dots )-\frac{1}{z}\ast (1+\frac{1}{2z}+\frac{1}{(2z{)}^{2}}+\cdots +\frac{1}{(2z{)}^{k}}+\dots )$

Therefore, the origin is an essential singularity of $f(z)$ with residue $-1$.

High school statisticsAnswered question

pulpenoe 2022-09-24

Suppose we have model $Y=X\beta $ and first collumn of $X$ consists of 1$1$. Why the sum of residuals in the this regression model equals $0$? And why in generall it doesn't, when there is no constant term?

High school statisticsAnswered question

vagnhestagn 2022-09-07

In a normal linear model (with intercept), show that if the residuals satisfy ${e}_{i}=a+\beta {x}_{i}$, for $i=1\dots n$, where $x$ is a predictor in the model, then each residual is equal to zero.

How to do this

How to do this

High school statisticsAnswered question

Brodie Beck 2022-09-07

Let's suppose a regression between earnings and age (and suppose I do not know the distribution of earnings). Would it be possible for the residuals to be normally distributed?

I am thinking it would not be possible since earnings only takes on positive values and since the support of the normal is from $-\mathrm{\infty}$ to $\mathrm{\infty}$, it would not be normal. However, since residuals are errors, they can be both positive and negative, so I am starting to question my hypothesis here.

I am thinking it would not be possible since earnings only takes on positive values and since the support of the normal is from $-\mathrm{\infty}$ to $\mathrm{\infty}$, it would not be normal. However, since residuals are errors, they can be both positive and negative, so I am starting to question my hypothesis here.

High school statisticsOpen question

Ronin Tran 2022-08-22

In a simple linear regression $Y=X\beta +\epsilon $, residuals are given by $\hat{\epsilon}=M\epsilon $, where $M={I}_{n}-P$ is the annihilator matrix, and $P=X({X}^{T}X{)}^{-1}{X}^{T}$ is the projection matrix, and $X$ is the design matrix. Assuing that the errors $\epsilon $ are iid normal with mean $0$ and standard deviation$\sigma $, what is the joint (conditional on $X$) distribution of the residuals $\hat{\epsilon}$?

High school statisticsOpen question

roletatx 2022-08-21

Model:

${y}_{i}={B}_{0}+\sum _{i=0}^{p}{B}_{k}{X}_{ik}+{e}_{i}$

show the sum of squared residuals is zero if $p=(n-1)$

${y}_{i}={B}_{0}+\sum _{i=0}^{p}{B}_{k}{X}_{ik}+{e}_{i}$

show the sum of squared residuals is zero if $p=(n-1)$

High school statisticsOpen question

Makayla Eaton 2022-08-17

When the residuals follow a normal distribution, the most likely function that fits the data is found using least squares. In that case:

$y=f({x}_{i})+{r}_{i},\phantom{\rule{1em}{0ex}}r\sim \mathcal{N}(0,{\sigma}^{2})$

What happens when $r\sim \mathcal{N}(0,\sigma (x{)}^{2})\phantom{\rule{mediummathspace}{0ex}}$?

$y=f({x}_{i})+{r}_{i},\phantom{\rule{1em}{0ex}}r\sim \mathcal{N}(0,{\sigma}^{2})$

What happens when $r\sim \mathcal{N}(0,\sigma (x{)}^{2})\phantom{\rule{mediummathspace}{0ex}}$?

High school statisticsOpen question

Trevor Rush 2022-08-16

Consider a linear regression model, i.e., $Y={\beta}_{0}+{\beta}_{1}{x}_{i}+{\u03f5}_{i}$, where ${\u03f5}_{i}$ satisfies the classical assumptions. The estimation method of the coefficients ($({\beta}_{0},\beta )$) is the least-squared method. What would be an intuitive explanation of why the sum of residuals is $0$?

High school statisticsOpen question

sarahkobearab4 2022-08-16

We've got some data containing two variables, where $x$ is the predictor and $y$ is the response variable. We make a model of the form of:

$y=\alpha +\beta \cdot x+\u03f5$

Then we see that in the residual plot (residuals vs. $\hat{y}$) the variance is increasing as $\hat{y}$. We then decide to transform our model to a logarithmic form, i.e.:

$log(y)=\alpha +\beta \cdot x+\u03f5$

When performing a residual plot analysis, do we plot residuals vs. $\hat{log(y)}$ or $\hat{y}$?

$y=\alpha +\beta \cdot x+\u03f5$

Then we see that in the residual plot (residuals vs. $\hat{y}$) the variance is increasing as $\hat{y}$. We then decide to transform our model to a logarithmic form, i.e.:

$log(y)=\alpha +\beta \cdot x+\u03f5$

When performing a residual plot analysis, do we plot residuals vs. $\hat{log(y)}$ or $\hat{y}$?

High school statisticsAnswered question

Landon Wolf 2022-08-09

Why are errors independent but residuals dependent?

Sum of the residuals within a random sample is necessarily zero, and thus the residuals are necessarily not independent. But also we assume that E(ϵ)=0. Why doesn't it imply errors are also not independent?

Sum of the residuals within a random sample is necessarily zero, and thus the residuals are necessarily not independent. But also we assume that E(ϵ)=0. Why doesn't it imply errors are also not independent?

- 1
- 2

Math can be tricky, but understanding residuals can make it easier. Residuals are a way to measure the difference between a predicted value and the actual value in a regression analysis. Residuals are calculated by subtracting the predicted value from the observed value. They can be used to tell if a model is accurate or not. A negative residual indicates that the observed value is larger than the predicted value, and a positive residual indicates that the predicted value is larger than the observed value. When the residuals are small, it means that the model is accurate. Understanding how residuals work can give you a better understanding of how your data is being used. With the right knowledge, you can make the most of your data and make better decisions.