// Numbas version: finer_feedback_settings {"name": "Chi-square goodness of fit test", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "parts": [{"variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "
Enter the expected blood type frequencies:
\nBlood Type | \nO | \nA | \nB | \nAB | \n
Expected frequencies | \n[[0]] | \n[[1]] | \n[[2]] | \n[[3]] | \n
Enter the value for the appropriate test statistic: \\(\\chi^2\\) = [[4]]
\n", "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "2.5*{p1}", "showFeedbackIcon": true, "minValue": "2.5*{p1}", "variableReplacements": [], "allowFractions": false}, {"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "2.5*{p2}", "showFeedbackIcon": true, "minValue": "2.5*{p2}", "variableReplacements": [], "allowFractions": false}, {"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "2.5*{p3}", "showFeedbackIcon": true, "minValue": "2.5*{p3}", "variableReplacements": [], "allowFractions": false}, {"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "2.5*{p4}", "showFeedbackIcon": true, "minValue": "2.5*{p4}", "variableReplacements": [], "allowFractions": false}, {"variableReplacementStrategy": "originalfirst", "allowFractions": false, "marks": "2", "precision": "2", "showPrecisionHint": true, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "strictPrecision": false, "notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "scripts": {}, "type": "numberentry", "precisionType": "dp", "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "minValue": "test_statistic", "maxValue": "test_statistic", "variableReplacements": [], "mustBeReduced": false}], "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "scripts": {}}, {"choices": ["Reject the Null hypothesis that the island community share the same blood type proportions in their population as the people in the general population.
", "Reject the Null Hypothesis at the 5% significance level but accept the Null Hypothesis at the 2% significance level and conclude that the island community share the same blood type proportions in their population as the people in the general population.
", "Reject the Null Hypothesis at the 10% significance level but accept the Null Hypothesis at the 5% significance level and conclude that the island community share the same blood type proportions in their population as the people in the general population.
", "Accept the Null Hypothesis at the 10% significance level and conclude that the island community share the same blood type proportions in their population as the people in the general population.
"], "maxMarks": "3", "marks": 0, "shuffleChoices": false, "variableReplacementStrategy": "originalfirst", "prompt": "Having compared your test statistic with the table values for a two-tailed \\(\\chi^2\\)-test-test, select one of the following answers that best describes your conclusion.
", "displayColumns": "1", "showCorrectAnswer": true, "minMarks": "3", "displayType": "radiogroup", "type": "1_n_2", "matrix": "decision_matrix", "showFeedbackIcon": true, "variableReplacements": [{"variable": "", "part": "p0", "must_go_first": false}], "scripts": {}}], "rulesets": {}, "tags": [], "ungrouped_variables": ["test_statistic", "Chi_95", "scenario", "decision_matrix", "Chi_98", "Chi_90", "n2", "n3", "n1", "n4", "p1", "p2", "p3", "p4", "total", "e1", "e2", "e3", "e4", "k", "n"], "statement": "The proportion of blood types O, A, B, AB in the general population of a particular country are known to be in the ratio \\(\\var{p1}:\\var{p2}:\\var{p3}:\\var{p4}\\) respectively.
\nA research team, tested the residents of a small island community in the country and obtained the following data.
\nBlood Type | \nO | \nA | \nB | \nAB | \n
Observed Frequency | \n\\(\\simplify{{n1}}\\) | \n\\(\\simplify{{n2}}\\) | \n\\(\\simplify{{n3}}\\) | \n\\(\\simplify{{n4}}\\) | \n
Test the hypothesis that the island community share the same blood type proportions in their population as the people in the general population.
\\(H_1:\\) The island community do not share the same blood type proportions in their population as the people in the general population.
\n\nThe population of the island \\(=\\) the total number of observations \\(=\\var{n1}+\\var{n2}+\\var{n3}+\\var{n4}=\\simplify{{n1}+{n2}+{n3}+{n4}}\\)
\n\\(\\var{p1}\\)% of the population have type O we therefore expect \\(\\left(\\frac{\\var{p1}}{100}\\right)*(\\var{total})=\\var{e1}\\) people to have type O.
\n\\(\\var{p2}\\)% of the population have type A we therefore expect \\(\\left(\\frac{\\var{p2}}{100}\\right)*(\\var{total})=\\var{e2}\\) people to have type A.
\n\\(\\var{p3}\\)% of the population have type B we therefore expect \\(\\left(\\frac{\\var{p3}}{100}\\right)*(\\var{total})=\\var{e3}\\) people to have type B.
\n\\(\\var{p4}\\)% of the population have type O we therefore expect \\(\\left(\\frac{\\var{p4}}{100}\\right)*(\\var{total})=\\var{e4}\\) people to have type AB.
\n\nThe formula for the t-statistic:
\n\\(\\chi^2=\\sum{\\frac{(obs-exp)^2}{exp}}\\)
\n\\(\\chi^2=\\frac{(\\var{n1}-\\var{e1})^2}{\\var{e1}}+\\frac{(\\var{n2}-\\var{e2})^2}{\\var{e2}}+\\frac{(\\var{n3}-\\var{e3})^2}{\\var{e3}}+\\frac{(\\var{n4}-\\var{e4})^2}{\\var{e4}}=\\var{test_statistic}\\)
\nWe only need to consider the upper value.
\nThe \\(\\chi^2\\)-table values will be for a two-tailed test and will have \\(4-1=3\\) degrees of freedom. We only need to consider the upper value, looking this up gives:
\n\\(\\begin{array}{r|rrrr}&0.10&0.05&0.02\\\\\\hline3&\\var{Chi_90}&\\var{Chi_95}&\\var{Chi_98}\\end{array}\\)
\nCompare the test statistic with the \\(\\chi^2\\)-table values and choose your conclusion.
", "extensions": ["stats"], "name": "Chi-square goodness of fit test", "variablesTest": {"condition": "", "maxRuns": 100}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}