// Numbas version: finer_feedback_settings {"name": "Z-test on sample mean", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "type": "question", "preamble": {"css": "", "js": ""}, "advice": "
In this example we have a single sample of 30 data values. The sample is just large enough to apply a Z-test
\n\\(H_0:\\) The mean \\(=\\simplify{{mu1}-{k}}\\).
\n\\(H_1:\\) The mean \\(\\ne \\simplify{{mu1}-{k}}\\).
\nGiven a sample of size \\(n\\) recall:
\nthe formula for the sample mean: \\(\\overline{x}=\\frac{\\sum {x}}{n}=\\var{sample_mean_2}\\)
\nthe formula for the sample standard deviation: \\(s=\\sqrt{\\frac{\\sum{(x-\\overline{x})^2}}{n-1}}=\\var{sample_stdev_2}\\)
\nthe formula for the Z-statistic: \\(Z=\\frac{\\overline{x}-\\mu}{\\frac{s}{\\sqrt{n}}}=\\frac{\\var{sample_mean_2}-\\simplify{{mu1}-{k}}}{\\frac{\\var{sample_stdev_2}}{\\sqrt{\\var{sample_size}}}}=\\var{test_statistic}\\)
\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.
", "rulesets": {}, "variable_groups": [], "name": "Z-test on sample mean", "ungrouped_variables": ["sample_size", "r1", "decision_matrix", "sample_mean_2", "sample_stdev_2", "mu1", "scenario", "sigm1", "t95", "t99", "k", "t90", "test_statistic"], "functions": {}, "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "extensions": ["stats"], "variables": {"t90": {"name": "t90", "group": "Ungrouped variables", "definition": "1.65", "description": "", "templateType": "number"}, "sample_stdev_2": {"name": "sample_stdev_2", "group": "Ungrouped variables", "definition": "precround(sqrt(30*stdev(r1)^2/29),2)", "description": "", "templateType": "anything"}, "scenario": {"name": "scenario", "group": "Ungrouped variables", "definition": "sum(map(abs(test_statistic){r1[0]} | \n{r1[1]} | \n{r1[2]} | \n{r1[3]} | \n{r1[4]} | \n{r1[5]} | \n{r1[6]} | \n{r1[7]} | \n{r1[8]} | \n{r1[9]} | \n{r1[10]} | \n{r1[11]} | \n{r1[12]} | \n{r1[13]} | \n{r1[14]} | \n
{r1[15]} | \n{r1[16]} | \n{r1[17]} | \n{r1[18]} | \n{r1[19]} | \n{r1[20]} | \n{r1[21]} | \n{r1[22]} | \n{r1[29]} | \n{r1[23]} | \n{r1[24]} | \n{r1[25]} | \n{r1[26]} | \n{r1[27]} | \n{r1[28]} | \n
It is believed that the mean lifespan for Irish men is \\(\\simplify{{mu1}-{k}}\\) years.
\nDoes the data support this theory?
\n", "parts": [{"type": "gapfill", "scripts": {}, "variableReplacementStrategy": "originalfirst", "marks": 0, "showFeedbackIcon": true, "showCorrectAnswer": true, "gaps": [{"precision": "2", "type": "numberentry", "mustBeReducedPC": 0, "scripts": {}, "maxValue": "sample_mean_2", "strictPrecision": false, "marks": 1, "showFeedbackIcon": true, "precisionType": "dp", "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": false, "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "sample_mean_2", "notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "variableReplacements": [], "allowFractions": false}, {"precision": "2", "type": "numberentry", "mustBeReducedPC": 0, "scripts": {}, "maxValue": "sample_stdev_2", "strictPrecision": false, "marks": 1, "showFeedbackIcon": true, "precisionType": "dp", "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": false, "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "sample_stdev_2", "notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "variableReplacements": [], "allowFractions": false}, {"precision": "2", "type": "numberentry", "mustBeReducedPC": 0, "scripts": {}, "maxValue": "test_statistic", "strictPrecision": false, "marks": "1", "showFeedbackIcon": true, "precisionType": "dp", "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": false, "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "test_statistic", "notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "variableReplacements": [{"must_go_first": true, "part": "p0g0", "variable": "sample_mean_2"}, {"must_go_first": true, "part": "p0g1", "variable": "sample_stdev_2"}], "allowFractions": false}], "prompt": "Give all your answers correct to two decimal places.
\nInput the sample mean: \\(\\bar{x}=\\) [[0]]
\nInput the sample standard deviation: \\(s=\\) [[1]]
\nEnter the value for the test statistic: \\(Z=\\) [[2]]
\n", "variableReplacements": []}, {"type": "1_n_2", "maxMarks": "2", "variableReplacementStrategy": "originalfirst", "marks": 0, "showFeedbackIcon": true, "displayColumns": "1", "minMarks": "2", "choices": ["Reject the Null Hypothesis and conclude that mean lifespan for an Irish man is not \\(\\simplify{{mu1}-{k}}\\).
", "Reject the Null Hypothesis at the 5% significance level but accept the Null Hypothesis at the 1% significance level and conclude that mean lifespan for an Irish man is \\(\\simplify{{mu1}-{k}}\\).
", "Reject the Null Hypothesis at the 10% significance level but accept the Null Hypothesis at the 5% significance level and conclude that mean lifespan for an Irish man is \\(\\simplify{{mu1}-{k}}\\).
", "Accept the Null Hypothesis at the 10% significance level and conclude that meanlifespan for an Irish man is \\(\\simplify{{mu1}-{k}}\\).
"], "shuffleChoices": false, "scripts": {}, "matrix": "decision_matrix", "displayType": "radiogroup", "showCorrectAnswer": true, "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.
", "variableReplacements": [{"must_go_first": false, "part": "p0g2", "variable": "test_statistic"}]}], "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/"}]}