// Numbas version: exam_results_page_options {"name": "Simon's copy of 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": [{"extensions": ["stats"], "advice": "


(a)

\n

Test statistic

\n

We should use the t statistic as the population variance is unknown.

\n

This is an unpaired test so we must find the pooled standard deviation, as 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.

\n

The 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.)

\n

\n

(b)

\n

p value range.

\n

As  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%'])}

\n

We see that the $p$ value {pm[pval]}.

\n

\n

(c)

\n

Conclusion

\n

Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.

\n

{Correctc}.

", "name": "Simon's copy of Perform a t-test to decide if two sample means differ, ,", "preamble": {"js": "", "css": ""}, "variables": {"m1": {"definition": "random(280..400#10)", "name": "m1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "confl": {"definition": "[90,95,99]", "name": "confl", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "fac": {"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\")", "name": "fac", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "that": {"definition": "\"the average time spent on the telephone \"", "name": "that", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "mm": {"definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "name": "mm", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n1": {"definition": "random(5..15)", "name": "n1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tpsd": {"definition": "sqrt(((n1-1)*sd^2+(n2-1)*sd1^2)/(n-1))", "name": "tpsd", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "crit": {"definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "name": "crit", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tval1": {"definition": "abs(m-m1)*sqrt(n1*n2)/(tpsd*sqrt(n1+n2))", "name": "tval1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "dothis": {"definition": "switch(pval <2, 'retain','reject')", "name": "dothis", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "pm": {"definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "name": "pm", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "sd": {"definition": "random(55..85)", "name": "sd", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "psd": {"definition": "precround(tpsd,3)", "name": "psd", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "this": {"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.\"", "name": "this", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "units": {"definition": "\"seconds\"", "name": "units", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n2": {"definition": "random(20..30)-n1", "name": "n2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "things": {"definition": "\"male employees\"", "name": "things", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "correctc": {"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\")", "name": "correctc", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "dmm": {"definition": "if(pval<2,[1,0],[0,1])", "name": "dmm", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "pval": {"definition": "switch(tvalGiven 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.

\n

Link to use of t tables and p-values in Show steps.

"}, "parts": [{"showFeedbackIcon": true, "prompt": "\n

Step 1: Null hypothesis

\n

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$. 

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;:\\;\\mu_M \\neq \\mu_F$. 

\n

 

\n ", "customMarkingAlgorithm": "", "type": "information", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "useCustomName": false, "extendBaseMarkingAlgorithm": true}, {"sortAnswers": false, "gaps": [{"answer": "t", "showPreview": true, "failureRate": 1, "showFeedbackIcon": true, "checkVariableNames": false, "customMarkingAlgorithm": "", "type": "jme", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 1, "checkingType": "absdiff", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "vsetRange": [0, 1], "checkingAccuracy": 0.001, "useCustomName": false, "vsetRangePoints": 5, "extendBaseMarkingAlgorithm": true, "valuegenerators": [{"name": "t", "value": ""}]}, {"minValue": "psd", "correctAnswerStyle": "plain", "precision": "3", "showFeedbackIcon": true, "type": "numberentry", "allowFractions": false, "unitTests": [], "strictPrecision": false, "precisionPartialCredit": 0, "maxValue": "psd", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "correctAnswerFraction": false, "precisionType": "dp", "scripts": {}, "customMarkingAlgorithm": "", "customName": "", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "marks": 1, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision."}, {"minValue": "tval-tol", "correctAnswerStyle": "plain", "precision": "3", "showFeedbackIcon": true, "type": "numberentry", "allowFractions": false, "unitTests": [], "strictPrecision": false, "precisionPartialCredit": 0, "maxValue": "tval+tol", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "correctAnswerFraction": false, "precisionType": "dp", "scripts": {}, "customMarkingAlgorithm": "", "customName": "", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "marks": 1, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision."}], "showFeedbackIcon": true, "prompt": "

Step 3: Test statistic

\n

Should we use the z or t test statistic? Input z or t.

\n

[[0]]

\n

Now calculate the pooled standard deviation: [[1]] 

\n

 

\n

Now calculate the absolute value of the test statistic =  [[2]]  

\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).

", "customMarkingAlgorithm": "", "type": "gapfill", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "useCustomName": false, "extendBaseMarkingAlgorithm": true}, {"sortAnswers": false, "gaps": [{"minMarks": 0, "showFeedbackIcon": true, "displayType": "radiogroup", "customMarkingAlgorithm": "", "type": "1_n_2", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "showCellAnswerState": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "shuffleChoices": false, "displayColumns": 0, "useCustomName": false, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "maxMarks": 0, "matrix": "mm", "extendBaseMarkingAlgorithm": true}], "showFeedbackIcon": true, "prompt": "

Step 4:  p-value range

\n

Use tables to find a range for your p -value. 

\n

Choose the correct range here for p : [[0]]

\n

 

\n

", "customMarkingAlgorithm": "", "type": "gapfill", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "useCustomName": false, "extendBaseMarkingAlgorithm": true}, {"sortAnswers": false, "gaps": [{"minMarks": 0, "showFeedbackIcon": true, "displayType": "radiogroup", "customMarkingAlgorithm": "", "type": "1_n_2", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "showCellAnswerState": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "shuffleChoices": false, "displayColumns": 0, "useCustomName": false, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "maxMarks": 0, "matrix": "mm", "extendBaseMarkingAlgorithm": true}, {"minMarks": 0, "showFeedbackIcon": true, "displayType": "radiogroup", "customMarkingAlgorithm": "", "type": "1_n_2", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "showCellAnswerState": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "shuffleChoices": false, "displayColumns": 0, "useCustomName": false, "choices": ["Retain", "Reject"], "maxMarks": 0, "matrix": "dmm", "extendBaseMarkingAlgorithm": true}, {"minMarks": 0, "showFeedbackIcon": true, "displayType": "radiogroup", "customMarkingAlgorithm": "", "type": "1_n_2", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "showCellAnswerState": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "shuffleChoices": true, "distractors": ["", ""], "displayColumns": 0, "useCustomName": false, "choices": ["{Correctc}", "{Fac}"], "maxMarks": 0, "matrix": [1, 0], "extendBaseMarkingAlgorithm": true}], "showFeedbackIcon": true, "prompt": "

 Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?

\n

[[0]]

\n

Your Decision about $H_0$:

\n

[[1]]

\n

 

\n

Conclusion:

\n

[[2]]

", "customMarkingAlgorithm": "", "type": "gapfill", "showCorrectAnswer": true, "customName": "", "unitTests": [], "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "useCustomName": false, "extendBaseMarkingAlgorithm": true}], "ungrouped_variables": ["sd1", "pval", "evi1", "crit", "correctc", "tval1", "things", "m1", "tol", "units", "pm", "tpsd", "that", "psd", "fac", "confl", "evi", "mm", "dothis", "m", "dmm", "n", "this", "tval", "n1", "n2", "things1", "sd"], "statement": "\n

{this}

\n

A 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'])}

\n

Perform 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": [], "rulesets": {}, "variable_groups": [], "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}