// Numbas version: finer_feedback_settings {"name": "Two sample t-test: comparison of means", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "tags": [], "functions": {}, "name": "Two sample t-test: comparison of means", "ungrouped_variables": ["r1", "sample_mean_1", "sample_stdev_1", "mu1", "sigm1", "test_statistic", "t95", "scenario", "decision_matrix", "t99", "t90", "r2", "mu2", "sigm2", "sample_mean_2", "sample_stdev_2", "pooled_s", "sample_size", "k"], "parts": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "prompt": "
Input the sample mean for 2000 data: [[0]]
\nInput the sample standard deviation for 2000 data: [[1]]
\nInput the sample mean for 2010 data: [[3]]
\nInput the sample standard deviation for 2010 data: [[4]]
\nEnter the value for the test statistic: t = [[2]]
\n", "variableReplacements": [], "gaps": [{"variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "strictPrecision": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "sample_mean_1", "scripts": {}, "marks": 1, "allowFractions": false, "mustBeReduced": false, "precision": "2", "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "sample_mean_1", "showPrecisionHint": true}, {"variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "strictPrecision": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "sample_stdev_1", "scripts": {}, "marks": 1, "allowFractions": false, "mustBeReduced": false, "precision": "2", "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "sample_stdev_1", "showPrecisionHint": true}, {"variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [{"variable": "sample_mean_2", "must_go_first": true, "part": "p0g0"}, {"variable": "sample_stdev_2", "must_go_first": true, "part": "p0g1"}], "strictPrecision": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "test_statistic", "scripts": {}, "marks": 1, "allowFractions": false, "mustBeReduced": false, "precision": "2", "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "test_statistic", "showPrecisionHint": true}, {"variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "strictPrecision": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "sample_mean_2", "scripts": {}, "marks": 1, "allowFractions": false, "mustBeReduced": false, "precision": "2", "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "sample_mean_2", "showPrecisionHint": true}, {"variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "strictPrecision": true, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "sample_stdev_2", "scripts": {}, "marks": 1, "allowFractions": false, "mustBeReduced": false, "precision": "2", "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "sample_stdev_2", "showPrecisionHint": true}], "marks": 0}, {"variableReplacementStrategy": "originalfirst", "maxMarks": "3", "displayColumns": "1", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "", "must_go_first": false, "part": "p0g2"}], "scripts": {}, "marks": 0, "displayType": "radiogroup", "matrix": "decision_matrix", "choices": ["Reject the Null Hypothesis and conclude that mean hydrocarbon emission rate has decreased.
", "Reject the Null Hypothesis at the 5% significance level but accept the Null Hypothesis at the 1% significance level and conclude that mean hydrocarbon emission rate is the same for both models.
", "Reject the Null Hypothesis at the 10% significance level but accept the Null Hypothesis at the 5% significance level and conclude that mean hydrocarbon emission rate is the same for both models.
", "Accept the Null Hypothesis at the 10% significance level and conclude that mean hydrocarbon emission rate is the same for both models.
"], "type": "1_n_2", "prompt": "Having compared your test statistic with the table values for a one-tailed t-test with 28 degrees of freedom, select one of the following conclusions that best describes your conclusion.
", "minMarks": "3", "shuffleChoices": false}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"decision_matrix": {"description": "", "definition": "[\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]\n][scenario]", "templateType": "anything", "name": "decision_matrix", "group": "Ungrouped variables"}, "k": {"description": "", "definition": "random(3..6#1)", "templateType": "randrange", "name": "k", "group": "Ungrouped variables"}, "r2": {"description": "", "definition": "repeat(round(normalsample(mu2,sigm2)),sample_size)", "templateType": "anything", "name": "r2", "group": "Ungrouped variables"}, "mu1": {"description": "", "definition": "random(220..240#1)", "templateType": "randrange", "name": "mu1", "group": "Ungrouped variables"}, "sample_mean_2": {"description": "", "definition": "precround(mean(r2),2)", "templateType": "anything", "name": "sample_mean_2", "group": "Ungrouped variables"}, "scenario": {"description": "", "definition": "sum(map(abs(test_statistic)In this example we are comparing the means of two distict samples.
\n\\(H_0:\\) \\(\\mu_1=\\mu_2\\) i.e. The mean emission rate is the same for both sets of cars.
\n\\(H_1:\\) \\(\\mu_1>\\mu_2\\) i.e. The mean emission rate of the older set of cars is greater than the mean emission rate of the newer set of cars.
\nFor each sample we must evaluate the sample mean and the sample standard deviation.
\nRecall when given a sample of size \\(n\\) :
\nthe formula for the sample mean: \\(\\overline{x}=\\frac{\\sum {x}}{n}\\)
\n\\(\\overline{x_1}=\\var{sample_mean_1}\\) and \\(\\overline{x_2}=\\var{sample_mean_2}\\)
\nthe formula for the sample standard deviation: \\(s=\\sqrt{\\frac{\\sum{(x-\\overline{x})^2}}{n-1}}\\)
\n\\(s_1=\\var{sample_stdev_1}\\) and \\(s_2=\\var{sample_stdev_2}\\)
\nWe must evaluate the pooled sample standard deviation using the two sample standard deviartions \\(s_1\\) and \\(s_2\\) and the formula
\n\\(s_p=\\sqrt{\\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}}=\\sqrt{\\frac{14(\\var{sample_stdev_1})^2+14(\\var{sample_stdev_2})^2}{15+15-2}}=\\var{pooled_s}\\)
\nThe formula for the t-statistic:
\n\\(t=\\frac{\\overline{x_1}-\\overline{x_2}}{s_p\\sqrt{\\frac{1}{n_1}+\\frac{1}{n_2}}}=\\frac{\\var{sample_mean_1}-\\var{sample_mean_2}}{\\var{pooled_s}\\sqrt{\\frac{1}{14}+\\frac{1}{14}}}=\\var{test_statistic}\\)
\nThe t-table value will be for a one-tailed test and will have \\(n_1+n_2-2=28\\) degrees of freedom. Because of the alternative hypothesis the t-value chosen will be positive.
\n\\[\\begin{array}{r|rrrr}&0.10&0.05&0.01\\\\\\hline28&\\var{t90}&\\var{t95}&\\var{t99}\\end{array}\\]
\nCompare the test statistic with the t-table values and choose your conclusion.
\n", "statement": "It is believed that the hydrocarbon emissions of cars have decreased in the first decade of the new millenium. A study was conducted to compare the hydrocarbon emissions at idling speed, in parts per million (ppm), of cars built in 2000 and cars built in 2010. Fifteen cars from each year were randomly selected on the year of their production and their hydrocarbon emission levels were recorded.
\nThe data gathered is tabled below:
\n2000 Model | \n{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
2010 Model | \n{r2[0]} | \n{r2[1]} | \n{r2[2]} | \n{r2[3]} | \n{r2[4]} | \n{r2[5]} | \n{r2[6]} | \n{r2[7]} | \n{r2[8]} | \n{r2[9]} | \n{r2[10]} | \n{r2[11]} | \n{r2[12]} | \n{r2[13]} | \n{r2[14]} | \n
", "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/"}]}