<p>Formulas can be checked against infinite online resources, not here.  </p>

<p>The most widespread use of $x$ and $X$ to distinguish something, is when it is needed to emphasize what is treated in theoretical derivations as a realized value (a fixed number, $x$), and what as a random variable, $X$. When using matrix algebra though bold uppercase denotes a matrix (but in panel data where everything is a matrix, we see often simple uppercase to denote a matrix).</p>

<p>Sometimes, authors don't bother, since it should be obvious from context.</p>

<p>Perhaps the most usual confounding is to use lowercase $x$ for either a realized value or a random variable, but use uppercase letters for random variables.  </p>

<p>As for calculation, it is always done using data, so there is nothing to "convert" here. If you have the realized data on $X$ and $Y$, then plug them in the formula. </p>

<p>Any other contrasting use of the two is of course not "forbidden", but then one should read carefully how each author defines their use. Nevertheless, to use simply $x$ to denote "a variable centered on its sample mean" $x=X-\bar X$, is rather unusual and confusing I would say, and in any case it does not warrant a change from lowercase to uppercase. We usually write things like</p>

<p>$$x^* \equiv x-\bar x$$</p>

<p>or some other symbol instead of a star.</p>

CC BY-SA 3.0
2017-12-28T22:29:51.323Z
A textbook that uses the convention $x_i = X_i-\bar X$ is Gujarati, D N *Essentials of Econometrics* (3rd ed'n) where it's introduced on p 147.
Adam Bailey
CC BY-SA 3.0
2017-12-28T22:41:30.513Z
@AdamBailey Thanks for the info... in which case I wonder how the author writes the uncentered variable, with uppercase?  And how does it go about distinguishing between values and variables? Perhaps the need does not arise for the level of the book?
Alecos Papadopoulos
CC BY-SA 3.0
2017-12-28T20:12:43.297Z
2017-12-28T22:21:44.957Z
2017-12-28T22:21:44.957Z
Alecos Papadopoulos
<p>Sorry for my bad english, i'll try to explain my difficulty. </p>

<p><strong>1° Question</strong></p>

<p>In the last exam an exercise asked to derivate OLS estimators and calculate their value with the data provided (ex.: $\sum x_iy_i=...$, $\sum Y_i=...$). Now, I know how to derivate them ($\hat{\beta _{0}}=\bar{Y} -\hat{\beta _{1}}\bar{Y}$ and $\hat{\beta _{1}}=\frac{\sum_{i=1}^{n}(X_i-\bar{X})(Y_i-\bar{Y})}{\sum_{i=1}^{n}(X_i-\bar{X})^2}$) but i have difficulties calculating them because data can be "big" ($X$) or "little" ($x$). My prof. tried to explain me that $x=X-\bar{X}$ but my difficulties remain. For example: assuming that $\sum x_iy_i=...$, $\sum Y_i=...$, $\sum X_{i}^{2}=...$ and $\sum X_i=...$: all data are uncertain except the last. I know that $\hat{\beta _{1}}$ can be written like
$=\frac{\sum_{i=1}^{n}X_iY_i- n\bar{X}\bar{Y}}{\sum_{i=1}^{n}X_{i}^{2}-n\bar{X}^2}$: so, how can i transform $x_iy_i$ in $X_iY_i$ to use it in the formula? </p>

<p><strong>2° Question</strong></p>

<p>In light of the problems that i have for the 1° question, i can't write a good form so i ask you if formulas below are corrected:</p>

<ul>
<li>mean for observed variables: $\bar{x}=\frac{1}{n}\sum x_i$</li>
<li>variance for observed variables: ${s_{X}}^{2}=\frac{1}{n}\sum (x_i-\bar{x})^2=\frac{1}{n}\sum ({x_{i}}^{2}-2x_i\bar{x}+\bar{x}^2)=\bar{x^2}-\bar{x}^2=\frac{1}{n}\sum {x_{i}}^{2}-\bar{x}^2$</li>
<li>standard deviation for observed variables: ${s_{X}}^{2}=\sqrt{\frac{1}{n}\sum (x_i-\bar{x})^2}$</li>
<li>covariance for observed variables: ${s_{XY}}=\frac{1}{n}\sum (x_i-\bar{x})(y_i-\bar{y})=\bar{xy}-\bar{x}\bar{y}=\frac{1}{n}\sum x_iy_i-(\frac{1}{n}\sum x_i)(\frac{1}{n}\sum y_i)$</li>
<li>correlation for observed variables: ${r_{XY}}=\frac{s_{XY}}{s_{X}s_{Y}}=\frac{\frac{1}{n}\sum x_iy_i-(\frac{1}{n}\sum x_i)(\frac{1}{n}\sum y_i)}{\sqrt{\frac{1}{n}\sum (x_i-\bar{x})^2\cdot\frac{1}{n}\sum (y_i-\bar{y})^2}}=\frac{\sum (x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum (x_i-\bar{x})^2\cdot\sum (y_i-\bar{y})^2}}=\frac{\sum x_iy_i-n\bar{x}\bar{y}}{({\sum x_{i}}^{2}-n\bar{x}^2)({\sum y_{i}}^{2}-n\bar{y}^2)}$</li>
<li>sample mean: $\bar{X}=\frac{1}{n}\sum X_i$</li>
<li>sample variance: ${S_{e}}^{2}=\frac{1}{n}\sum (X_i-\bar{X})^2$</li>
<li>standard error: $SE=\sqrt{\frac{1}{n}\sum (X_i-\bar{X})^2}$</li>
<li>corrected estimator for sample variance: $S^2=\frac{1}{n-1}\sum (X_i-\bar{X})^2$ with $S^2=\frac{n}{n-1}{S_{e}}^{2}$</li>
<li>$R^2$: $R^2=(r_{XY})^2$ or $R^2=\frac{ESS}{TSS}=\frac{\sum_{i=1}^{n}(\hat{y_i}-\bar{y})^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2}\Rightarrow ESS=R^2\cdot TSS=(r_{XY})^2\cdot (\sum {y_{i}}^{2}-n\bar{y}^2)\Rightarrow RSS=TSS-ESS$</li>
<li>estimate of the variance of residuals: $SER=\sqrt{\frac{1}{n-2}\sum (e_i-\bar{e})^2}=\frac{RSS}{n-2}$</li>
</ul>

<econometrics><statistics><applied-econometrics><instrumental-variable>
Difference between $x$ and $X$
Francesco Totti
# Difference between $x$ and $X$

(Asked by: username_0 on 2017-12-28)

Sorry for my bad english, i'll try to explain my difficulty.

**1° Question**

In the last exam an exercise asked to derivate OLS estimators and calculate their value with the data provided (ex.: $\sum x\_iy\_i=...$, $\sum Y\_i=...$). Now, I know how to derivate them ($\hat{\beta \_{0}}=\bar{Y} -\hat{\beta \_{1}}\bar{Y}$ and $\hat{\beta \_{1}}=\frac{\sum\_{i=1}^{n}(X\_i-\bar{X})(Y\_i-\bar{Y})}{\sum\_{i=1}^{n}(X\_i-\bar{X})^2}$) but i have difficulties calculating them because data can be "big" ($X$) or "little" ($x$). My prof. tried to explain me that $x=X-\bar{X}$ but my difficulties remain. For example: assuming that $\sum x\_iy\_i=...$, $\sum Y\_i=...$, $\sum X\_{i}^{2}=...$ and $\sum X\_i=...$: all data are uncertain except the last. I know that $\hat{\beta \_{1}}$ can be written like
$=\frac{\sum\_{i=1}^{n}X\_iY\_i- n\bar{X}\bar{Y}}{\sum\_{i=1}^{n}X\_{i}^{2}-n\bar{X}^2}$: so, how can i transform $x\_iy\_i$ in $X\_iY\_i$ to use it in the formula?

**2° Question**

In light of the problems that i have for the 1° question, i can't write a good form so i ask you if formulas below are corrected:

* mean for observed variables: $\bar{x}=\frac{1}{n}\sum x\_i$
* variance for observed variables: ${s\_{X}}^{2}=\frac{1}{n}\sum (x\_i-\bar{x})^2=\frac{1}{n}\sum ({x\_{i}}^{2}-2x\_i\bar{x}+\bar{x}^2)=\bar{x^2}-\bar{x}^2=\frac{1}{n}\sum {x\_{i}}^{2}-\bar{x}^2$
* standard deviation for observed variables: ${s\_{X}}^{2}=\sqrt{\frac{1}{n}\sum (x\_i-\bar{x})^2}$
* covariance for observed variables: ${s\_{XY}}=\frac{1}{n}\sum (x\_i-\bar{x})(y\_i-\bar{y})=\bar{xy}-\bar{x}\bar{y}=\frac{1}{n}\sum x\_iy\_i-(\frac{1}{n}\sum x\_i)(\frac{1}{n}\sum y\_i)$
* correlation for observed variables: ${r\_{XY}}=\frac{s\_{XY}}{s\_{X}s\_{Y}}=\frac{\frac{1}{n}\sum x\_iy\_i-(\frac{1}{n}\sum x\_i)(\frac{1}{n}\sum y\_i)}{\sqrt{\frac{1}{n}\sum (x\_i-\bar{x})^2\cdot\frac{1}{n}\sum (y\_i-\bar{y})^2}}=\frac{\sum (x\_i-\bar{x})(y\_i-\bar{y})}{\sqrt{\sum (x\_i-\bar{x})^2\cdot\sum (y\_i-\bar{y})^2}}=\frac{\sum x\_iy\_i-n\bar{x}\bar{y}}{({\sum x\_{i}}^{2}-n\bar{x}^2)({\sum y\_{i}}^{2}-n\bar{y}^2)}$
* sample mean: $\bar{X}=\frac{1}{n}\sum X\_i$
* sample variance: ${S\_{e}}^{2}=\frac{1}{n}\sum (X\_i-\bar{X})^2$
* standard error: $SE=\sqrt{\frac{1}{n}\sum (X\_i-\bar{X})^2}$
* corrected estimator for sample variance: $S^2=\frac{1}{n-1}\sum (X\_i-\bar{X})^2$ with $S^2=\frac{n}{n-1}{S\_{e}}^{2}$
* $R^2$: $R^2=(r\_{XY})^2$ or $R^2=\frac{ESS}{TSS}=\frac{\sum\_{i=1}^{n}(\hat{y\_i}-\bar{y})^2}{\sum\_{i=1}^{n}(y\_i-\bar{y})^2}\Rightarrow ESS=R^2\cdot TSS=(r\_{XY})^2\cdot (\sum {y\_{i}}^{2}-n\bar{y}^2)\Rightarrow RSS=TSS-ESS$
* estimate of the variance of residuals: $SER=\sqrt{\frac{1}{n-2}\sum (e\_i-\bar{e})^2}=\frac{RSS}{n-2}$

**Tags:** econometrics, statistics, applied-econometrics, instrumental-variable

---

## 1 answers

### Answer by username_1 on 2017-12-28. Score: 2

Formulas can be checked against infinite online resources, not here.

The most widespread use of $x$ and $X$ to distinguish something, is when it is needed to emphasize what is treated in theoretical derivations as a realized value (a fixed number, $x$), and what as a random variable, $X$. When using matrix algebra though bold uppercase denotes a matrix (but in panel data where everything is a matrix, we see often simple uppercase to denote a matrix).

Sometimes, authors don't bother, since it should be obvious from context.

Perhaps the most usual confounding is to use lowercase $x$ for either a realized value or a random variable, but use uppercase letters for random variables.

As for calculation, it is always done using data, so there is nothing to "convert" here. If you have the realized data on $X$ and $Y$, then plug them in the formula.

Any other contrasting use of the two is of course not "forbidden", but then one should read carefully how each author defines their use. Nevertheless, to use simply $x$ to denote "a variable centered on its sample mean" $x=X-\bar X$, is rather unusual and confusing I would say, and in any case it does not warrant a change from lowercase to uppercase. We usually write things like

$$x^\* \equiv x-\bar x$$

or some other symbol instead of a star.

> **Comments:**
> **username_2**: A textbook that uses the convention $x_i = X_i-\bar X$ is Gujarati, D N *Essentials of Econometrics* (3rd ed'n) where it's introduced on p 147.  
> **username_1**: @AdamBailey Thanks for the info... in which case I wonder how the author writes the uncentered variable, with uppercase?  And how does it go about distinguishing between values and variables? Perhaps the need does not arise for the level of the book?  

---

