// Numbas version: exam_results_page_options {"name": "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": "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? 

\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:      \\(\\overline{p}=\\frac{{x}}{n}\\) where \\(x\\) is the number of observations

\n

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

\n

the formula for the Z-statistic:     \\(Z=\\frac{\\overline{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

\n

The Z-table values will be for a two-tailed test are given below. 

\n

significance              10%                    5%                   1%

\n

      limits                \\(\\pm1.65\\)             \\(\\pm1.96\\)             \\(\\pm2.58\\)

\n

Compare the test statistic with the Z-table values and choose your conclusion.

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "round(0.85*p*100)", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "precround({prop1}/{n1},2)", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "random(360 .. 450#10)", "description": "", "templateType": "randrange", "can_override": false}, "Z99": {"name": "Z99", "group": "Ungrouped variables", "definition": "2.58", "description": "", "templateType": "number", "can_override": false}, "pop_p": {"name": "pop_p", "group": "Ungrouped variables", "definition": "precround({percentage}/100,2)", "description": "

pop_p

", "templateType": "anything", "can_override": false}, "prop1": {"name": "prop1", "group": "Ungrouped variables", "definition": "random(100 .. 125#1)", "description": "", "templateType": "randrange", "can_override": false}, "Z90": {"name": "Z90", "group": "Ungrouped variables", "definition": "1.65", "description": "", "templateType": "number", "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}, "Z95": {"name": "Z95", "group": "Ungrouped variables", "definition": "1.96", "description": "", "templateType": "number", "can_override": false}, "atvalue": {"name": "atvalue", "group": "Ungrouped variables", "definition": "abs(test_statistic)", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "if(atvalue>=Z99,[1,0,0,0],if(atvalue>=Z95,[0,1,0,0],if(atvalue>=Z90,[0,0,1,0],[0,0,0,1])))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["Z95", "Z99", "test_statistic", "Z90", "n1", "p", "percentage", "prop1", "pop_p", "atvalue", "v"], "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": "

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

\n

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

\n

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "sample_mean_2", "part": "p0", "must_go_first": true}, {"variable": "sample_stdev_2", "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": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "test_statistic", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Having compared your test statistic with the table values for a two-tailed Z-test, select one of the following conclusions that best describes your conclusion.

", "minMarks": "2", "maxMarks": "2", "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["

Reject the Null Hypothesis and conclude conclude that the proportion of people who will delay seeking healthcare treatment due to the associated cost is not given by \\(p=\\frac{\\var{percentage}}{100}\\).

", "

Reject the Null Hypothesis at the 5% significance level but accept the Null Hypothesis at the 1% significance level and conclude that the proportion of people who will delay seeking healthcare treatment due to the associated cost is given by \\(p=\\frac{\\var{percentage}}{100}\\).

", "

Reject the Null Hypothesis at the 10% significance level but accept the Null Hypothesis at the 5% significance level and conclude that the proportion of people who will delay seeking healthcare treatment due to the associated cost is given by \\(p=\\frac{\\var{percentage}}{100}\\).

", "

Accept the Null Hypothesis at the 10% significance level and conclude that the proportion of people who will delay seeking healthcare treatment due to the associated cost is given by \\(p=\\frac{\\var{percentage}}{100}\\). 

"], "matrix": "v"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}