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.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기