// Numbas version: finer_feedback_settings
{"name": "Perform a t-test to decide if two sample means differ, , ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "evi": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "description": "", "name": "evi"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..15)", "description": "", "name": "n1"}, "confl": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[90,95,99]", "description": "", "name": "confl"}, "sd1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(65..90)", "description": "", "name": "sd1"}, "correctc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval>1,\"There is evidence to suggest that average call times for male and female employees differ\",\"There is insufficent evidence to suggest that average call times for male and female employees differ\")", "description": "", "name": "correctc"}, "tval1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "abs(m-m1)*sqrt(n1*n2)/(tpsd*sqrt(n1+n2))", "description": "", "name": "tval1"}, "crit": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "description": "", "name": "crit"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"A call centre company wants to know if there is any difference between the average time spent on the telephone, per call to customers, between male and female employees.\"", "description": "", "name": "this"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "n1+n2-1", "description": "", "name": "n"}, "tval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tval1,3)", "description": "", "name": "tval"}, "dothis": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval <2, 'retain','reject')", "description": "", "name": "dothis"}, "pm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "description": "", "name": "pm"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(20..30)-n1", "description": "", "name": "n2"}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "description": "", "name": "mm"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"male employees\"", "description": "", "name": "things"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(220..380#10)", "description": "", "name": "m"}, "evi1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "description": "", "name": "evi1"}, "units": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"seconds\"", "description": "", "name": "units"}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(55..85)", "description": "", "name": "sd"}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(280..400#10)", "description": "", "name": "m1"}, "fac": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,\"There is evidence to suggest that average call times for male and female employees differ\",\"There is insufficent evidence to suggest that average call times for male and female employees differ\")", "description": "", "name": "fac"}, "tpsd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqrt(((n1-1)*sd^2+(n2-1)*sd1^2)/(n-1))", "description": "", "name": "tpsd"}, "dmm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,[1,0],[0,1])", "description": "", "name": "dmm"}, "that": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"the average time spent on the telephone \"", "description": "", "name": "that"}, "pval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(tval
If $\\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 ", "showCorrectAnswer": true, "scripts": {}, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "t", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "psd+tol", "minValue": "psd-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "tval+tol", "minValue": "tval-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "
Step 3: Test statistic
\nShould we use the z or t test statistic? Input z or t.
\n[[0]]
\nNow calculate the pooled standard deviation: [[1]] (to 3 decimal places)
\n\n
Now calculate the test statistic = ? [[2]] (to 3 decimal places)
\n\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).
", "showCorrectAnswer": true, "marks": 0}, {"stepsPenalty": 0, "scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}], "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]]
\n\n
Click on Show steps below to get more information on using the t tables to find the p-value range. You will not lose any marks.
\n", "steps": [{"type": "information", "prompt": "
Click here to get more information about using t tables.
\nYou will also find the critical values of the t tables in this link.
", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}, {"displayType": "radiogroup", "choices": ["Retain", "Reject"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "dmm", "marks": 0}, {"displayType": "radiogroup", "choices": ["{Correctc}", "{Fac}"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0], "marks": 0}], "type": "gapfill", "prompt": "\nGiven 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 ", "showCorrectAnswer": true, "marks": 0}], "statement": "\n{this}
\nA random sample of $\\var{n1}$ {things} and $\\var{n2}$ {things1} gave the following results in {units}.
\n{table([['Male',{m},{sd}],['Female',{m1},{sd1}]],[' ','Mean','Standard deviation'])}
\nPerform an appropriate hypothesis test to see if there is any difference between {that} between {things} and {things1} (the null and alternative hypotheses have been set out for you).
\n ", "tags": ["ACC1012", "accept null hypothesis", "ACE2013", "alternative hypothesis", "checked2015", "comparing means", "degree of freedom", "diagram", "hypothesis testing", "link", "MAS1403", "null hypothesis", "p values", "pooled standard deviation", "population variance", "random sample", "reject null hypothesis", "sample mean", "sampling", "sc", "statistics", "Steps", "steps", "t tables", "t test", "test statistic", "two-tailed test"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t3/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", "licence": "Creative Commons Attribution 4.0 International", "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.
\nLink to use of t tables and p-values in Show steps.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "
b)
Step 3 : Test statistic
\nWe 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.)
\nc)
\nStep 4: p value range.
\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]}.
\nd)
\nStep 5: Conclusion
\nHence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}.
", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}