// Numbas version: finer_feedback_settings {"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", "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "ungrouped_variables": ["Z95", "scenario", "decision_matrix", "Z99", "test_statistic", "Z90", "n1", "p", "prop1", "percentage", "pop_p"], "extensions": ["stats"], "type": "question", "statement": "
A recent poll of \\(\\var{n1}\\) people indicated that \\(\\var{prop1}\\) of them had delayed seeking healthcare treatment due to the associated cost.
\nIt has long been believed that \\(\\var{percentage}\\)% of people will delay seeking healthcare treatment due to the associated cost.
\nDoes the data support this theory?
\n", "variable_groups": [], "functions": {}, "variables": {"Z99": {"name": "Z99", "templateType": "number", "description": "", "group": "Ungrouped variables", "definition": "2.58"}, "p": {"name": "p", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "precround({prop1}/{n1},2)"}, "Z95": {"name": "Z95", "templateType": "number", "description": "", "group": "Ungrouped variables", "definition": "1.96"}, "Z90": {"name": "Z90", "templateType": "number", "description": "", "group": "Ungrouped variables", "definition": "1.65"}, "test_statistic": {"name": "test_statistic", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "(p-percentage/100)/sqrt((percentage*(100-percentage)/10000)/n1)"}, "decision_matrix": {"name": "decision_matrix", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "[\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]\n][scenario]"}, "n1": {"name": "n1", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(360..450#10)"}, "percentage": {"name": "percentage", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "round(0.85*p*100)"}, "prop1": {"name": "prop1", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(100..125#1)"}, "scenario": {"name": "scenario", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "sum(map(abs(test_statistic)Enter the value of the sample proportion: \\(p=\\) [[1]]
\nEnter the value for the appropriate test statistic: Z = [[0]]
\n", "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "gaps": [{"scripts": {}, "variableReplacements": [{"must_go_first": true, "part": "p0", "variable": "sample_mean_2"}, {"must_go_first": true, "part": "p0", "variable": "sample_stdev_2"}], "precisionPartialCredit": 0, "minValue": "test_statistic", "type": "numberentry", "maxValue": "test_statistic", "precision": "2", "mustBeReduced": false, "showPrecisionHint": true, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "strictPrecision": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "marks": "1"}, {"scripts": {}, "variableReplacements": [], "precisionPartialCredit": 0, "minValue": "{p}", "type": "numberentry", "maxValue": "{p}", "precision": "2", "mustBeReduced": false, "showPrecisionHint": true, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "strictPrecision": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "marks": 1}], "variableReplacementStrategy": "originalfirst", "marks": 0}, {"variableReplacements": [{"must_go_first": false, "part": "p0g0", "variable": "test_statistic"}], "matrix": "decision_matrix", "displayColumns": "1", "type": "1_n_2", "maxMarks": "2", "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}\\).
"], "displayType": "radiogroup", "variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "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", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"css": "", "js": ""}, "rulesets": {}, "advice": "\n\\(H_0:\\) p =\\(\\simplify{{percentage}/100}\\).
\n\\(H_1:\\) p \\(\\ne \\simplify{{percentage}/100}\\).
\nGiven a sample of size \\(n\\) recall:
\nthe 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}\\)
\nthe 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\nThe Z-table values will be for a two-tailed test are given below.
\nsignificance 10% 5% 1%
\nlimits \\(\\pm1.65\\) \\(\\pm1.96\\) \\(\\pm2.58\\)
\nCompare the test statistic with the Z-table values and choose your conclusion.
", "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/"}]}