How to compare observed and expected counts with GraphPad QuickCalcs
Example. Compare observed and expected frequencies.
Assume that an average of 10% of patients die during or immediately following a certain risky operation. But last month 16 of 75 patients died. You want to know whether the increase reflects a real change or whether it is just a coincidence. Statistical calculations cannot answer that question definitively, but they can answer a related one: If the probability of dying remained at 10%, what is the probability of observing 16 or more deaths out of 75 patients? If the probability of dying remained at 10%, we would expect 10% x 75 or 7.5 deaths in an average sample of 75 patients. But in a particular sample of 75 patients, we might see more or less than the expected number.
Enter the data into GraphPad's calculator like this:
Check the option that you entered the expected values as actual numbers expected. Or check the option that you are entering percentages and enter 90 and 10, rather than 67.5 and 7.5.
Here are the results:
How the calculations work.
The null hypothesis is that the observed data are sampled from a populations with the expected frequencies. We need to combine together the discrepancies between the observed and expected, and then calculate a P value answering this question: If the null hypothesis were true, what is the chance of randomly selecting subjects with this large a discrepancy between observed and expected counts?
We can combine the observed and expected counts into a variable, chi-square. To calculate chi-square:
When there are only two categories, some statisticians recommend using the Yates' correction. Reduces the value of chi-square so increases the P value. With large sample sizes, this correction makes little difference. With small samples, it makes more difference. Statisticians disagree about when to use the Yates' correction, and this calculator does not apply it.