// Numbas version: finer_feedback_settings {"name": "Testing an hypothesis about the mean of a group (2).", "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": ["hypval", "mdlower", "mdupper", "meansal", "mu1", "object", "objects", "outcome", "r1", "sdsal", "sed", "sig1", "stdlower", "stdupper", "t95", "tcalc", "thismany", "tlower", "tupper"], "name": "Testing an hypothesis about the mean of a group (2).", "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

{meansal}

\n

Then the standard deviation (sd) of the sample:

\n

{sdsal}

\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": "

As part of regular maintenance, an assistant in an aquarium shop measures the salinity in its sea water tanks every week day (i.e. Monday to Friday). Normal salinity for sea water is 35 ppt (parts per thousand or 35 g of salt in 1 l of water). 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

Is the salinity normal?

\n

In other words, test the following null hypothesis:

\n

H0: Mean salinity is equal to 35 ppt.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"mu1": {"definition": "random(30..40#0.5)", "templateType": "anything", "group": "Ungrouped variables", "name": "mu1", "description": ""}, "tlower": {"definition": "tcalc-0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "tlower", "description": ""}, "mdupper": {"definition": "meansal+0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "mdupper", "description": ""}, "stdupper": {"definition": "sdsal+0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "stdupper", "description": ""}, "object": {"definition": "'Sample'", "templateType": "anything", "group": "Ungrouped variables", "name": "object", "description": ""}, "hypval": {"definition": "35", "templateType": "anything", "group": "Ungrouped variables", "name": "hypval", "description": ""}, "sig1": {"definition": "random(2..5#0.2)", "templateType": "anything", "group": "Ungrouped variables", "name": "sig1", "description": ""}, "thismany": {"definition": "6", "templateType": "anything", "group": "Ungrouped variables", "name": "thismany", "description": ""}, "objects": {"definition": "'samples'", "templateType": "anything", "group": "Ungrouped variables", "name": "objects", "description": ""}, "mdlower": {"definition": "meansal-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((meansal-hypval)/(sdsal/sqrt(thismany)),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "tcalc", "description": ""}, "t95": {"definition": "2.571", "templateType": "anything", "group": "Ungrouped variables", "name": "t95", "description": ""}, "sed": {"definition": "precround(sdsal/sqrt(thismany),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "sed", "description": ""}, "outcome": {"definition": "if((abs(tcalc)>t95),1,0)", "templateType": "anything", "group": "Ungrouped variables", "name": "outcome", "description": ""}, "sdsal": {"definition": "precround(pstdev(r1),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "sdsal", "description": ""}, "stdlower": {"definition": "sdsal-0.025", "templateType": "anything", "group": "Ungrouped variables", "name": "stdlower", "description": ""}, "meansal": {"definition": "precround(mean(r1),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "meansal", "description": ""}, "r1": {"definition": "repeat(precround(normalsample(mu1,sig1),1),6)", "templateType": "anything", "group": "Ungrouped variables", "name": "r1", "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/"}], "resources": []}]}], "contributors": [{"name": "Keith McGuinness", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/523/"}]}