Statistics notation is a case study in one letter carrying two jobs: \sigma is a standard deviation and \sum is a summation, while \bar is an accent rather than a line. Whether a formula is about a sample or a population is decided by which letter you type; whether the mark looks right is decided by accent width. The two pages this one leans on are Math Accents and Summation.
Which one to use
\bar{x}\overline{x_i}\mus^2\hat{\theta}\sigma, sThe commands
\overline{x} draws a wider rule but is meant for overlines in complex conjugates. \bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i
\mu = \frac{1}{N}\sum_{i=1}^{N} x_i
s^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2
\sigma^2 = \frac{1}{N}\sum_{i=1}^{N}(x_i - \mu)^2
\sqrt. \sigma = \sqrt{\sigma^2}
\Sigma is sometimes typed as the sum operator in older texts; \sum is the correct operator. \sum x_i \quad \sum x_i^2 \quad \Sigma X
\bar{x} = \frac{\sum f_i x_i}{\sum f_i}
\hat{\mu} \quad \hat{p} = \frac{x}{n}
\mathrm{E} is the conservative one. \mathbb{E}[X] = \sum_x x\,P(X=x)
z = \frac{x - \mu}{\sigma}
Worked examples
Variance in one-line shortcut form
\sigma^2 = \frac{\sum x_i^2}{n} - \mu^2
The computational form still taught in syllabuses; identical value, easier arithmetic.
Mean and deviation together
\bar{x} = 12.4, \qquad s = 1.8
Reporting results with the comma-separated pair, using \quad because a plain space collapses.
Correlation coefficient
r = \frac{\sum (x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum (x_i-\bar{x})^2 \sum (y_i-\bar{y})^2}}
Deeply nested accents inside a fraction — the case where \dfrac or display maths stops the inner terms crushing.
Distribution shorthand
\bar{X} \sim N\left(\mu, \frac{\sigma^2}{n}\right)
Sampling distribution of the mean, tilde-style \sim read as "is distributed as".
Common mistakes
- Using
\Sigmawhere\sumis meant. The first is a capital letter sized like text; the second is the big operator that carries bounds. - Writing
x_barorx̄copied from a PDF. Use\bar{x}; the pasted combining character breaks in most editors. - Setting
nandNin the same formula without deciding which is the sample and which the population. Case carries the meaning. - Typing
Var(x)andmean(x)as words. They print as italic products; use\mathrm{Var}or\operatorname{Var}.
Questions about this notation
What is the difference between \sum and \sigma?
\sum is the n-ary addition operator that takes lower and upper bounds; \sigma is the lowercase Greek letter used as a name for standard deviation. They occupy different grammatical roles in a formula.How do I write x bar in LaTeX?
\bar{x} for a single character, \overline{AB} when the rule has to span several. For a mean of a multi-token expression, \bar{x} is normal and the braces keep only the x under the accent.Should sample statistics be lowercase?
\bar{x}, s^2 and n describe your data; \mu, \sigma^2 and N describe the population. Uppercase X and Y denote random variables rather than observed values, which is why \bar{X} appears in sampling theory.How do I write expectation, variance and standard deviation as proper operators?
\mathbb{E}[X] is the usual expectation and needs amssymb for the blackboard bold. Variance and standard deviation are not core commands: declare them once with \DeclareMathOperator{\Var}{Var} from amsmath, so they print upright with operator spacing instead of looking like a product of separate variables.Keep reading
Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.