// Numbas version: exam_results_page_options {"percentPass": 0, "allQuestions": true, "feedback": {"advicethreshold": 0, "showtotalmark": true, "allowrevealanswer": true, "showactualmark": true, "showanswerstate": true}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Three questions on parametric hypothesis testing and confidence intervals, aimed at psychology students.
", "notes": ""}, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Stephanie's copy of BS4.3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Stephanie Greaves", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/340/"}], "functions": {}, "ungrouped_variables": ["claim", "pval", "evi1", "crit", "tval1", "things", "stand", "tol", "test", "pm", "correctc", "resultis", "fac", "confl", "evi", "this", "dothis", "m", "dmm", "n", "mm", "thisamount", "tval"], "tags": ["Probability", "accept null hypothesis", "alternative hypothesis", "critical value", "decision", "degree of freedom", "diagram", "evidence", "hypothesis testing", "null hypothesis", "p value", "population variance", "probability", "random sample", "reject null hypothesis", "sample mean", "sample standard deviation", "sampling", "sc", "statistics", "t tables", "t test", "test statistic", "two-tailed test"], "advice": "$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thisamount}$
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$
\nWe should use the $t$ statistic as the population variance is unknown.
\nThe test statistic:
\n\\[t =\\frac{ |\\var{m} -\\var{thisamount}|} {\\sqrt{\\frac{\\var{stand} ^ 2 }{\\var{n}}}} = \\var{tval}\\]
\nto 3 decimal places.
\nAs $n=\\var{n}$ we use the $t_{\\var{n-1}}$ tables. We have the following data from the tables:
\n{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}
\nWe see that the $p$ value {pm[pval]}.
\nHence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}
", "rulesets": {}, "parts": [{"prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;$[[1]]
\n ", "marks": 0, "gaps": [{"allowFractions": false, "scripts": {}, "maxValue": "thisamount", "minValue": "thisamount", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "scripts": {}, "maxValue": "thisamount", "minValue": "thisamount", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Step 3: Test statistic
\nShould we use the $z$ or $t$ test statistic? [[0]] (enter $z$ or $t$)
\nNow calculate the test statistic = [[1]] (to 3 decimal places)
", "marks": 0, "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "answer": "t", "checkingtype": "absdiff", "checkvariablenames": false, "vsetrange": [0, 1]}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "scripts": {}, "precision": "3", "maxValue": "tval+tol", "minValue": "tval-tol", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\nStep 4: p-value
\nUse tables to find a range for your $p$-value.
\nChoose the correct range here for $p$ : [[0]]
\n ", "marks": 0, "gaps": [{"distractors": ["", "", "", ""], "matrix": "mm", "shuffleChoices": false, "scripts": {}, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\nStep 5: Conclusion
\n\n
Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour Decision:
\n[[1]]
\n\n
Conclusion:
\n[[2]]
\n ", "marks": 0, "gaps": [{"distractors": ["", "", "", ""], "matrix": "mm", "shuffleChoices": false, "scripts": {}, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}, {"distractors": ["", ""], "matrix": "dmm", "shuffleChoices": false, "scripts": {}, "choices": ["Retain", "Reject"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}, {"distractors": ["", ""], "matrix": [1, 0], "shuffleChoices": true, "scripts": {}, "choices": ["{Correctc}", "{Fac}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "{this}
\n{claim}
\n{test}
\nA sample of $\\var {n}$ {things}
\n{resultis} £$\\var {m}$ with a standard deviation of £$\\var{stand}$.
\nPerform an appropriate hypothesis test to see if the claim made by the Royal medical group is substantiated (use a two-tailed test).
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"claim": {"definition": "\"The average cost of a treatment of benzodiazepines with us is just \u00a3\" + {thisamount} + \" (including all taxes and charges!)\"", "templateType": "anything", "group": "Ungrouped variables", "name": "claim", "description": ""}, "pval": {"definition": "switch(tval2/01/2012:
\n \t\tAdded tag sc as has string variables in order to generate other scenarios.
\n \t\tThe jstat function studenttinv(critvalue,n-1) gives the critical p values correctly.
\n \t\tAdded tag diagram as the i-assess question advice has a nice graphic of the p-value and the appropriate decision.
\n \t\t", "description": "Provided with information on a sample with sample mean and standard deviation, but no information on the population variance, use the t test to either accept or reject a given null hypothesis.
", "licence": "None specified"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Stephanie's EDITED BS4.5 Psychology", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Stephanie Greaves", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/340/"}], "functions": {}, "ungrouped_variables": ["confl", "correctc", "crit", "dmm", "dothis", "evi", "evi1", "fac", "m", "m1", "mm", "n", "n1", "n2", "pm", "psd", "pval", "sd", "sd1", "that", "things", "things1", "this", "tol", "tpsd", "tval", "tval1", "units"], "tags": ["accept null hypothesis", "alternative hypothesis", "comparing means", "degree of freedom", "diagram", "hypothesis testing", "null hypothesis", "p values", "pooled standard deviation", "population variance", "random sample", "reject null hypothesis", "sample mean", "sampling", "sc", "statistics", "t tables", "t test", "test statistic", "two-tailed test"], "advice": "We should use the $t$ statistic as the population variance is unknown.
\nThe pooled standard deviation is given by :
\n\\[s = \\sqrt{\\frac{\\var{n1 -1} \\times \\var{sd} ^ 2 + \\var{n2 -1} \\times \\var{sd1} ^ 2 }{\\var{n1} + \\var{n2} -2}} = \\var{tpsd} = \\var{psd}\\] to 3 decimal places.
\nThe test statistic is given by \\[t = \\frac{|\\var{m} -\\var{m1}|}{s \\sqrt{\\frac{1}{ \\var{n1} }+\\frac{1}{ \\var{n2}}}} = \\var{tval}\\] to 3 decimal places.
\n(Using $s=\\var{tpsd}$ in this formula. )
\nAs the degree of freedom is $\\var{n1}+\\var{n2}-2=\\var{n-1}$ we use the $t_{\\var{n-1}}$ tables. We have the following data from the tables:
\n{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}
\nWe see that the $p$ value {pm[pval]}.
\nHence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}.
", "rulesets": {}, "parts": [{"prompt": "\nStep 1: Null hypothesis
\nIf $\\mu_M$ is the mean for time spent by {things} and $\\mu_F$ is the mean for time spent by {things1} then you are given that:
\n$\\operatorname{H}_0\\;:\\;\\mu_M=\\mu_F$.
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;:\\;\\mu_M \\neq \\mu_F$.
\n\n ", "type": "information", "marks": 0, "showCorrectAnswer": true, "scripts": {}}, {"prompt": "
Step 3: Test statistic
\nShould we use the $z$ or $t$ test statistic?
\n[[0]]
\nNow calculate the pooled standard deviation: [[1]] (to 3 decimal places)
\nNow calculate the test statistic: [[2]] (to 3 decimal places)
\n(Note that in this calculation you should use a value for the pooled standard deviation which is accurate to at least 5 decimal places and not the value you found to 3 decimal places above).
", "marks": 0, "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "answer": "t", "checkingtype": "absdiff", "checkvariablenames": false, "vsetrange": [0, 1]}, {"allowFractions": false, "scripts": {}, "maxValue": "psd+tol", "minValue": "psd-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "scripts": {}, "maxValue": "tval+tol", "minValue": "tval-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Step 4: p-value range
\nUse tables to find a range for your $p$ -value.
\nChoose the correct range here for $p$ : [[0]]
", "marks": 0, "gaps": [{"distractors": ["", "", "", ""], "matrix": "mm", "shuffleChoices": false, "scripts": {}, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour Decision:
\n[[1]]
\nConclusion:
\n[[2]]
", "marks": 0, "gaps": [{"distractors": ["", "", "", ""], "matrix": "mm", "shuffleChoices": false, "scripts": {}, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}, {"distractors": ["", ""], "matrix": "dmm", "shuffleChoices": false, "scripts": {}, "choices": ["Retain", "Reject"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}, {"distractors": ["", ""], "matrix": [1, 0], "shuffleChoices": true, "scripts": {}, "choices": ["{Correctc}", "{Fac}"], "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "marks": 0, "displayColumns": 0, "type": "1_n_2", "maxMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "{this}
\nA random sample of $\\var{n1}$ {things} and $\\var{n2}$ {things1} gave the following results in {units}.
\n{table([[capitalise(things),{m},{sd}],[capitalise(things1),{m1},{sd1}]],[' ','Mean','Standard deviation'])}
\nPerform an appropriate hypothesis test to see if there is any difference in {that} between {things} and {things1} (the null and alternative hypotheses have been set out for you).
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"sd1": {"definition": "random(65..90)", "templateType": "anything", "group": "Ungrouped variables", "name": "sd1", "description": ""}, "pval": {"definition": "switch(tval3/01/2012:
\n \t\tAdded tag sc as can be changed to other applications. Perhaps the tables used should be improved.
\n \t\tMissing a diagram from the original iassess question, hence tag diagram added.
\n \t\t", "description": "Given two sets of data, sample mean and sample standard deviation, on performance on the same task, make a decision as to whether or not the mean times differ. Population variance not given, so the t test has to be used in conjunction with the pooled sample standard deviation.
", "licence": "None specified"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Stephanie's EDITED copy of BS4.1 Psychology", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Stephanie Greaves", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/340/"}], "functions": {}, "ungrouped_variables": ["uci", "tuci", "dothis", "invt", "m", "n", "p", "s", "tlci", "t", "units", "lci", "confl", "sc", "spec", "tinvt", "sd"], "tags": ["confidence interval for the mean", "confidence intervals", "mean", "sample", "sampling", "sc", "standard deviation", "statistics", "student t test", "t tables", "t test"], "preamble": {"css": "", "js": ""}, "advice": "The population variance is unknown. So we have to use the $t$ tables to find the confidence interval.
\nWe now calculate the $\\var{confl}$% confidence interval:
\nAs we have $\\var{n}-1=\\var{n-1}$ degrees of freedom, the interval is given by:
\n\\[ \\var{m[s]} \\pm t_{\\var{n-1}}\\sqrt{\\frac{\\var{sd[s]}^2}{\\var{n}}}\\]
\nLooking up the t tables for $\\var{confl}$% we see that $t_{\\var{n-1}}=\\var{invt}$ to 3 decimal places.
\nHence:
\nLower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{invt} \\sqrt{\\frac{\\var{sd[s]} ^ 2} {\\var{n}}} = \\var{p}\\var{lci}${units} to 2 decimal places.
\nUpper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{invt} \\sqrt{\\frac{\\var{sd[s]} ^ 2} {\\var{n}}} = \\var{p}\\var{uci}${units} to 2 decimal places.
\n", "rulesets": {}, "parts": [{"prompt": "
Is the population variance known or unknown?
\n[[0]]
", "marks": 0, "gaps": [{"displayColumns": 0, "matrix": [0, 1], "shuffleChoices": true, "maxMarks": 0, "distractors": ["", ""], "choices": ["Known", "Unknown"], "displayType": "radiogroup", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "minMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Calculate a $\\var{confl}$% confidence interval $(a,b)$ for the population mean:
\n$a=$ [[0]]{units}
\n$b=$ [[1]]{units}
\nEnter both to 2 decimal places.
\n", "marks": 0, "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": 1, "precision": "2", "maxValue": "lci+0.01", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "minValue": "lci-0.01", "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": 1, "precision": "2", "maxValue": "uci+0.01", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "minValue": "uci-0.01", "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "
The Newcastle Psychology department wants to {dothis[s]}.
\nA random sample of {spec} $\\var{n}$ {t[s]} gave a mean and standard deviation of {p} $\\var{m[s]}$ and {p} $\\var{sd[s]}$ respectively.
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"tinvt": {"definition": "studenttinv((confl+100)/200,n-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "tinvt", "description": ""}, "tuci": {"definition": "m[s]+invt*sqrt(sd[s]^2/n)", "templateType": "anything", "group": "Ungrouped variables", "name": "tuci", "description": ""}, "dothis": {"definition": "\n [\"estimate the mean amount of items on a tray students could memorize in 30 seconds\",\n \"estimate the mean IQ scores from students at Newcastle University\",\n \"estimate the mean hours worked per week by new graduates\"\n ]\n \n \n \n ", "templateType": "anything", "group": "Ungrouped variables", "name": "dothis", "description": ""}, "invt": {"definition": "precround(tinvt,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "invt", "description": ""}, "m": {"definition": "\n [random(15..35#001),\n random(100..120#001),\n random(34..48#0.5),\n random(100..300#0.5),\n random(10..20#0.5),\n random(3.5..6#0.5)]\n \n ", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "n": {"definition": "random(10..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "n", "description": ""}, "p": {"definition": "switch(s=0 or s=1 or s=3,'',' ')", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "s": {"definition": "random(0..abs(sc)-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "tlci": {"definition": "m[s]-invt*sqrt(sd[s]^2/n)", "templateType": "anything", "group": "Ungrouped variables", "name": "tlci", "description": ""}, "t": {"definition": "\n [\" students \",\n \" mathematics students \",\n \" workers\"\n ]\n \n ", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "sd": {"definition": "\n [random(1..5#0.10),\n random(10..15#5),\n random(2..5#0.5),\n random(10..40#0.5),\n random(1..3#0.5),\n random(0.5..1#0.1)]\n ", "templateType": "anything", "group": "Ungrouped variables", "name": "sd", "description": ""}, "units": {"definition": "switch(s=2,\"hours\",s=4,\"\",s=5,\"\",\" \")", "templateType": "anything", "group": "Ungrouped variables", "name": "units", "description": ""}, "confl": {"definition": "random(90,95,99)", "templateType": "anything", "group": "Ungrouped variables", "name": "confl", "description": ""}, "sc": {"definition": "\n [ \" a third year mathematics class\",\n \" students \",\n \"store assistants\"]\n ", "templateType": "anything", "group": "Ungrouped variables", "name": "sc", "description": ""}, "spec": {"definition": "if(s=2,\"the timecards of \", \" \")", "templateType": "anything", "group": "Ungrouped variables", "name": "spec", "description": ""}, "uci": {"definition": "precround(tuci,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "uci", "description": ""}, "lci": {"definition": "precround(tlci,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "lci", "description": ""}}, "metadata": {"notes": "1/01/2013:
\nUses the statistical extension which includes the necessary t statistic functions. There are string variables giving various scenarios and these can be added to by the author - except has to add values to arrays m and sd etc as well. Added tag sc.
\n6/01/2013:
\nImproved display of units.
", "description": "\n \t\tFinding the confidence interval at either 90%, 95% or 99% for the mean given the mean and standard deviation of a sample. The population variance is not given and so the t test has to be used. Various scenarios are included.
\n \t\t\n \t\t", "licence": "None specified"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "shuffleQuestions": false, "questions": [], "pickQuestions": 0, "timing": {"timeout": {"action": "none", "message": ""}, "allowPause": true, "timedwarning": {"action": "none", "message": ""}}, "name": "Parametric hypothesis testing", "duration": 0, "type": "exam", "showQuestionGroupNames": false, "navigation": {"browse": true, "allowregen": true, "reverse": true, "preventleave": true, "showfrontpage": true, "onleave": {"action": "none", "message": ""}, "showresultspage": "never"}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}