Chi-Squared in LaTeX (\chi^2)

χ2\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.

χ2=∑i=1k(Oi−Ei)2Ei\chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}
\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

All الاحتمالات والإحصاء →

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.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث