// Numbas version: finer_feedback_settings {"name": "Testing an hypothesis about the mean of a group (1).", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"pstdev": {"definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "type": "number", "parameters": [["l", "list"]], "language": "jme"}}, "ungrouped_variables": ["mu1", "r1", "sig1", "t95", "thismany", "tcalc", "tupper", "tlower", "mdupper", "mdlower", "stdupper", "stdlower", "outcome", "sed", "meanwgt", "sdwgt", "hypval"], "name": "Testing an hypothesis about the mean of a group (1).", "tags": ["average", "data analysis", "differences", "elementary statistics", "hypothesis testing", "mean", "mean of differences", "paired t-test", "standard deviation", "standard deviation of differences", "statistics", "stats", "t-test", "variance"], "advice": "

First, recognise that this is a one-sample (or \"mean to hypothetical value\") t-test.

\n

So calculate the mean of the sample:

\n

{meanwgt}

\n

Then the standard deviation (sd) of the sample:

\n

{sdwgt}

\n

Note: You should use your calculator to get both the mean and standard deviation.

\n

The standard error (se) is calculated as:

\n

\\[ se = \\frac{ sd }{ \\sqrt{ n }} \\]

\n

It is:

\n

{sed}

\n

Finally, calculate the test statisitic, t-calc, as the mean difference divided by the standard error:

\n

\\[ t-calc = \\frac{ mean difference }{ se} \\]

\n

t-calc = {tcalc}

\n

There are 6 {objects}, so 5 degrees of freedom, and the test is two-tailed, so the t-table = 2.571.

\n

If t-calc is greater than 2.571, the null is rejected. As this is a two-tailed test, the sign of t-calc (positive or negative) is ignored.

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "

Find the mean and standard deviation of the sample.

\n

Mean  = [[0]] (input  to 2 decimal places )

\n

Standard deviation  = [[1]] (input to 2 decimal places)

\n

Now find the one sample (or \"mean to hypothetical value\") t-test statistic using the values you have just calculated =[[2]] (input 2 decimal places)

\n

Is the null hypothesis rejected? [[3]] Enter 0 for \"No\" and 1 for \"Yes\".

", "marks": 0, "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "scripts": {}, "precision": "2", "maxValue": "{mdupper}", "minValue": "{mdlower}", "strictPrecision": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": "50", "marks": "1", "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "scripts": {}, "precision": "2", "maxValue": "{stdupper}", "minValue": "{stdlower}", "strictPrecision": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": "50", "marks": "1", "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "scripts": {}, "precision": "2", "maxValue": "{tupper}", "minValue": "{tlower}", "strictPrecision": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "scripts": {}, "maxValue": "{outcome}", "minValue": "{outcome}", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "

The Arnott’s biscuit company makes \"snack packs\" of many of its products, including Tiny Teddy (TT) and Pizza Shapes (PS). These packs are labelled \"25 g\". Test if TT meet the stated weight content. Sample data are in the table below:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{object}ABCDEF
Weight (g)$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$
\n

Are the packets, on average, the correct weight?

\n

In other words, test the following null hypothesis:

\n

H0: Mean weight is equal to 25 g.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"mu1": {"definition": "random(22..28#0.5)", "templateType": "anything", "group": "Ungrouped variables", "name": "mu1", "description": ""}, "r1": {"definition": "repeat(min(round(normalsample(mu1,sig1)),25),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "r1", "description": ""}, "mdupper": {"definition": "meanwgt+0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "mdupper", "description": ""}, "stdupper": {"definition": "sdwgt+0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "stdupper", "description": ""}, "meanwgt": {"definition": "precround(mean(r1),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "meanwgt", "description": ""}, "hypval": {"definition": "25", "templateType": "anything", "group": "Ungrouped variables", "name": "hypval", "description": ""}, "sig1": {"definition": "random(2..3#0.2)", "templateType": "anything", "group": "Ungrouped variables", "name": "sig1", "description": ""}, "thismany": {"definition": "6", "templateType": "anything", "group": "Ungrouped variables", "name": "thismany", "description": ""}, "sed": {"definition": "precround(sdwgt/sqrt(thismany),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "sed", "description": ""}, "mdlower": {"definition": "meanwgt-0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "mdlower", "description": ""}, "tupper": {"definition": "tcalc+0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "tupper", "description": ""}, "tcalc": {"definition": "precround((meanwgt-hypval)/(sdwgt/sqrt(thismany)),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "tcalc", "description": ""}, "t95": {"definition": "2.571", "templateType": "anything", "group": "Ungrouped variables", "name": "t95", "description": ""}, "stdlower": {"definition": "sdwgt-0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "stdlower", "description": ""}, "outcome": {"definition": "if((abs(tcalc)>t95),1,0)", "templateType": "anything", "group": "Ungrouped variables", "name": "outcome", "description": ""}, "sdwgt": {"definition": "precround(pstdev(r1),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "sdwgt", "description": ""}, "tlower": {"definition": "tcalc-0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "tlower", "description": ""}}, "metadata": {"notes": "", "description": "

Testing an hypothesis about the mean of one group.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Keith McGuinness", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/523/"}]}]}], "contributors": [{"name": "Keith McGuinness", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/523/"}]}