Wikipedia:Reference desk/Archives/Mathematics/2022 March 8

= March 8 =

Observed vs. expected values
Hi there, I was looking for help regarding a statistics question. I have a set of 2 x 2 observed values and 2 x 2 expected values in a spreadsheet. I was planning on using the chi-square test for independence with the Yates correction factor because my data fit the criterion to need the yates correction factor. I was wondering if there was any statistical test that compared the difference between my expected values with observed values, but not in a way that created expected values like the chi-squared test does. Thanks so much and any help is appreciated! JuxtaposedJacob (talk) 14:15, 8 March 2022 (UTC)
 * A general formula is given by:
 * $$\chi^2=\sum_i\frac{(O_i-E_i)^2}{E_i},$$
 * in which the $$O_i$$ are the observed and the $$E_i$$ the expected values. Note that if the expected values are obtained independently and not derived from the observed values, there are four degrees of freedom, instead of the usual one d.o.f. for a 2 × 2 contingency table. (This assumes there is no fixed relation at all connecting these values; if it is a given that $$\textstyle{\sum_i O_i=\sum_i E_i},$$ this takes away one d.o.f.) --Lambiam 14:42, 8 March 2022 (UTC)
 * See Fisher's exact test Robinh (talk) 00:32, 10 March 2022 (UTC)
 * Fisher's exact test does not allow one to compare the fit of observed values to one's own expected values. If the observed values are $20│50 10│20$, Fisher's test will give $p = 0.64$, even if the expected values are $20│10 10│60$ and the observations obviously do not match the expectations. --Lambiam 09:14, 10 March 2022 (UTC)