# Difference between $x$ and $X$

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}$

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.

• 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 Dec 28 '17 at 22:29
• @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 Dec 28 '17 at 22:41