// Numbas version: exam_results_page_options {"name": "Catherine's copy of Z-test on sample proportion", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Catherine's copy of Z-test on sample proportion", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

A recent poll of \\(\\var{n1}\\) people indicated that \\(\\var{prop1}\\) of them had delayed seeking healthcare treatment due to the associated cost.

\n

It has long been believed that \\(\\var{percentage}\\)% of people will delay seeking healthcare treatment due to the associated cost. 

\n

Does the data support this theory? You may assume a significance level of 5%.

\n

", "advice": "

\n

\\(H_0:\\)  p =\\(\\simplify{{percentage}/100}\\).

\n

\\(H_1:\\) p \\(\\ne \\simplify{{percentage}/100}\\).

\n

Given a sample of size \\(n\\) recall:

\n

the formula for the sample proportion:      \\(\\hat{p}=\\frac{{x}}{n}\\) where \\(n\\) is the number of observations

\n

 \\(\\hat{p}=\\frac{\\var{prop1}}{\\var{n1}}=\\var{p}\\)

\n

the formula for the Z-statistic:     \\(Z=\\frac{\\hat{p}-p}{\\sqrt{\\frac{p(1-p)}{n}}}\\)

\n

\\(Z=\\frac{\\var{p}-\\var{pop_p}}{\\sqrt{\\frac{\\var{pop_p}(1-\\var{pop_p})}{\\var{n1}}}}\\)

\n

\\(Z=\\frac{\\simplify{{p}-{pop_p}}}{\\sqrt{\\simplify{{pop_p}*(1-{pop_p})/{n1}}}}=\\var{test_statistic}\\)

\n

For a significance level of 5%:

\n

$z_{{\\frac{\\alpha}{2}}}=1.96$

\n

\n


d)

\n

{Correctc}

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"Z95": {"name": "Z95", "group": "Ungrouped variables", "definition": "1.96", "description": "", "templateType": "number", "can_override": false}, "scenario": {"name": "scenario", "group": "Ungrouped variables", "definition": "(map(abs(test_statistic)1.96,\"There is sufficient evidence against the quoted percentage.\",\n \"There is insufficient evidence against the quoted percentage.\")", "description": "", "templateType": "anything", "can_override": false}, "Z90": {"name": "Z90", "group": "Ungrouped variables", "definition": "1.65", "description": "", "templateType": "number", "can_override": false}, "mm": {"name": "mm", "group": "Ungrouped variables", "definition": "if(test_statistic<1.96,[0,1],[1,0])", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "round(0.85*p*100)", "description": "", "templateType": "anything", "can_override": false}, "Falsec": {"name": "Falsec", "group": "Ungrouped variables", "definition": "if(test_statistic<1.96,\"There is sufficient evidence against the quoted percentage\",\n \"There is insufficient evidence against the quoted percentage.\")", "description": "", "templateType": "anything", "can_override": false}, "pop_p": {"name": "pop_p", "group": "Ungrouped variables", "definition": "precround({percentage}/100,2)", "description": "

pop_p

", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "random(360 .. 450#10)", "description": "", "templateType": "randrange", "can_override": false}, "test_statistic": {"name": "test_statistic", "group": "Ungrouped variables", "definition": "(p-percentage/100)/sqrt((percentage*(100-percentage)/10000)/n1)", "description": "", "templateType": "anything", "can_override": false}, "Z99": {"name": "Z99", "group": "Ungrouped variables", "definition": "2.58", "description": "", "templateType": "number", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["Z95", "scenario", "Z99", "test_statistic", "Z90", "n1", "p", "prop1", "percentage", "pop_p", "mm", "Correctc", "Falsec"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; p=\\;$ [[0]]

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; p \\neq\\;$ [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "pop_p", "maxValue": "pop_p", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "pop_p", "maxValue": "pop_p", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Enter the value of the sample proportion: \\(\\hat{p}=\\) [[1]]

\n

Enter the value for the appropriate test statistic: = [[0]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "Z95", "part": "p0", "must_go_first": true}, {"variable": "Z95", "part": "p0", "must_go_first": true}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "test_statistic", "maxValue": "test_statistic", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{p}", "maxValue": "{p}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The critical value is [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1.96", "maxValue": "1.96", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Step 5:

\n

Your Decision: [[0]]

\n

\n

\n

 

\n

Conclusion: [[1]]

\n

", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["reject", "fail to reject"], "matrix": "mm"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["{Correctc}", "{Falsec}"], "matrix": ["1", 0], "distractors": ["", ""]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}