Navigation
Synopsis Chi-square coefficient of data values.
Function num chiSquare(lrel[num expected, int observed] values)
Usage import analysis::statistics::Inference;
Description Compute the ChiSquare statistic comparing observed and expected frequency counts.
Examples Consider an example from the web page mentioned above. To test the hypothesis that a random sample of 100 people has been drawn from a population in which men and women are equal in frequency, the observed number of men and women would be compared to the theoretical frequencies of 50 men and 50 women. If there were 44 men in the sample and 56 women, then we have the following:
rascal>import analysis::statistics::Inference;
ok
rascal>chiSquare([<50, 44>, <50, 56>])
num: 1.44
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.