Chi-Square Calculator

The chi-square statistic for an experiment with k possible outcomes, performed n times, in which Y1, Y2,… Yk are the number of experiments which resulted in each possible outcome, with probabilities of each outcome p1, p2,… pk is:

will be larger to the extent that the observed results diverge from those expected by chance. The probability Q that a X² value calculated for an experiment with d degrees of freedom (where d=k−1, one less the number of possible outcomes) is due to chance is:

Where Γ is the generalisation of the factorial function to real and complex arguments:

Unfortunately, there is no closed form solution for Q, so it must be evaluated numerically. This page allows you to calculate the probability of chance occurrence of a given X² for an experiment with d degrees of freedom, or to calculate X² given d and the probability Q. All calculations are performed with six decimal places of accuracy; the maximum X² accepted is thus 99999.

Note that the probability calculated from the X² is an approximation which is valid only for large values of n, and is therefore only meaningful when calculated from a large number of independent experiments.

In order to use this page, your browser must support JavaScript. The text field below indicates whether JavaScript is available; if not, consider switching to a browser which implements it.

Calculate probability from X² and d

One of the most common chi-square calculations is determining, given the measured X² value for a set of experiments with a degree of freedom d, the probability of the result being due to chance. Enter the X² and d values in the boxes below, press the Calculate button, and the probability will appear in the Q box.

Given X²= and d=

The chance probability, Q, is:

Calculate X² from probability Q and d

To determine the chi-square value indicating a probability Q of non-chance occurrence for an experiment with d degrees of freedom, enter Q and d in the boxes below and press Calculate.

Given probability Q= and d=

The X² value is:

by John Walker
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9825727939605713, "perplexity": 1005.4283459311478}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-36/segments/1471982931818.60/warc/CC-MAIN-20160823200851-00139-ip-10-153-172-175.ec2.internal.warc.gz"}