what is a chi square 2 statistic 
a chi square 2 statistic is a test that measures how a model compares to actual observed data the data used in calculating a chi square statistic must be random raw mutually exclusive drawn from independent variables and drawn from a large enough sample for example the results of tossing a fair coin meet these criteria chi square tests are often used to test hypotheses the chi square statistic compares the size of any discrepancies between the expected results and the actual results given the size of the sample and the number of variables in the relationship for these tests degrees of freedom are used to determine if a certain null hypothesis can be rejected based on the total number of variables and samples within the experiment as with any statistic the larger the sample size the more reliable the results formula for a chi square 2 statistic c 2 o i e i 2 e i where c degrees of freedom o observed value s begin aligned chi 2 c sum frac o i e i 2 e i textbf where c text degrees of freedom o text observed value s e text expected value s end aligned c2 ei oi ei 2 where c degrees of freedomo observed value s 