Chi-Squared in LaTeX (\chi^2)
- LaTeX command
\chi^2- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Chi-squared: the Greek letter chi squared, naming a distribution and a test statistic.
Pearson's statistic \chi^2 = \sum \frac{(O_i - E_i)^2}{E_i} compares observed and expected counts, and \chi^2_k denotes the distribution with k degrees of freedom. Note that \chi is the Greek letter chi; do not type an x, which looks somewhat similar but is a different glyph and sits differently on the baseline. To attach both the degrees of freedom and the square, write \chi^2_{k} or \chi_{k}^{2}; LaTeX stacks them identically either way. In results sections, report tests as \chi^2(2) = 6.1, p = 0.047, following your field's style guide.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Chi-Squared: $\chi^2$
\[ \chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i} \]
\end{document}Related symbols
- Binomial Coefficient
\binom{n}{k} - Rho
\rho - Factorial
n! - Given
P(A \mid B) - Proportional To
\propto - Conditional
\mid
Frequently asked questions
- How do I write Chi-Squared in LaTeX?
- Type \chi^2 in math mode, for example $\chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}$. It works in plain LaTeX without loading any package.
- Which package do I need for \chi^2?
- None. \chi^2 is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \chi^2 in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\chi^2$ in running text.
Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf
Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI
- Gumawa ng magagandang TikZ diagrams gamit ang AI
- Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
- Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers