// Numbas version: exam_results_page_options {"name": "Calculate confidence interval for the proportion Diagnostic Kit", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Calculate confidence interval for the proportion Diagnostic Kit", "tags": [], "metadata": {"description": "

\n

Calculate confidence interval for the proportion

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

A company manufacturing a diagnostic kit sent {n1} samples of the kit to an independent laboratory to be analysed. The number of diagnostic kits that met industry standards was {prop1}.

\n

\n

", "advice": "

\n

The estimate for the population proportion is $\\hat{p} =\\frac{{\\var{prop1}}}{\\var{n1}}=\\var{precround(p_hat,3)}$

\n

\n

The estimate for the standard error associated with $\\hat{p}$ is  $=\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{n}}=\\sqrt{\\frac{\\var{precround(p_hat,3)}\\times (1-\\var{precround(p_hat,3)})}{\\var{n1}}}=\\var{se}$

\n

 

\n

To construct a $\\var{percentage}$% confidence interval, $Z_\\frac{\\alpha}{2}=Z_\\frac{\\var{alpha2}}{2} = \\var{Z}$

\n

\n

Putting this information together, the lower bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} -Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1}}}=\\var{precround(p_hat,3)} -\\var{Z}\\times \\var{se}=\\var{precround(lower,2)}$

\n

The upper bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} +Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1}}}=\\var{precround(p_hat,3)} +\\var{Z}\\times \\var{se}=\\var{precround(upper,2)}$

\n

\n

\n

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p_hat": {"name": "p_hat", "group": "Unnamed group", "definition": "prop1/n1", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Unnamed group", "definition": "random(800..1000#50)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "p_hat+Z*sqrt((p_hat*(1-p_hat))/n1)", "description": "", "templateType": "anything", "can_override": false}, "alpha2": {"name": "alpha2", "group": "Unnamed group", "definition": "alpha*2", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "random([95,99])", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "p_hat-Z*sqrt((p_hat*(1-p_hat))/n1)", "description": "", "templateType": "anything", "can_override": false}, "se": {"name": "se", "group": "Ungrouped variables", "definition": "precround(sqrt((p_hat*(1-p_hat))/n1),4)", "description": "", "templateType": "anything", "can_override": false}, "prop1": {"name": "prop1", "group": "Unnamed group", "definition": "random(730..788#1)", "description": "", "templateType": "anything", "can_override": false}, "Z": {"name": "Z", "group": "Ungrouped variables", "definition": "precround(normalinv(1-alpha,0,1),2)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["upper", "percentage", "Z", "alpha", "lower", "se"], "variable_groups": [{"name": "Unnamed group", "variables": ["prop1", "p_hat", "n1", "alpha2"]}], "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": "

The sample proportion $\\hat{p}$ 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": "p_hat", "maxValue": "p_hat", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "4", "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 standard error of the sample proportion 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": "se", "maxValue": "se", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "3", "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": "

Calculate a {percentage}% confidence interval for the proportion of diagnostic kits that meet idustry standards.

\n

\n

Lower limit = [[0]]

\n

Upper limit = [[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": "lower-0.01", "maxValue": "lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "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": "upper-0.01", "maxValue": "upper+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "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}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}]}], "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}