// Numbas version: exam_results_page_options {"name": "Hypothesis test of t-distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "tags": ["MAS2302", "Normal distribution", "checked2015", "confidence level", "critical value", "mean ", "normal distribution", "null hypothesis", "random sample", "sample", "sample mean", "sample standard deviation", "siginicant", "t test", "tables"], "name": "Hypothesis test of t-distribution", "functions": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

For a sample of size n from a normal distribution, given mean of the sample mean and the standard deviation , find the t-statistic corresponding to a null hypothesis $\\mu=m$ and a given confidence level. Check if the result is significant at this level.

", "notes": "\n \t\t

27/01/2013:

\n \t\t

First draft completed.

\n \t\t"}, "ungrouped_variables": ["le", "that", "mm", "r11", "tr", "n", "mu", "isthis", "tol", "pert", "test", "st", "sd"], "parts": [{"scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "

Calculate the t-statistic you will need to test the null hypothesis:

\n

Test statistic $t=\\;$?[[0]] (to 3 decimal places).

\n

 

", "gaps": [{"showPrecisionHint": false, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "test+tol", "minValue": "test-tol", "scripts": {}, "marks": 1}], "marks": 0}, {"scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "

What is the critical value with which to compare $|t|$

\n

Critical value $=\\;$[[0]] (to 3 decimal places, the answer should be positive)

", "gaps": [{"showPrecisionHint": false, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "st+tol", "minValue": "st-tol", "scripts": {}, "marks": 1}], "marks": 0}, {"scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "

Is the test significant?

\n

[[0]]

", "gaps": [{"distractors": ["", ""], "displayColumns": 0, "showCorrectAnswer": true, "maxMarks": 0, "scripts": {}, "marks": 0, "displayType": "radiogroup", "matrix": "mm", "choices": ["

Yes

", "

No

"], "type": "1_n_2", "minMarks": 0, "shuffleChoices": false}], "marks": 0}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"st": {"name": "st", "description": "", "templateType": "anything", "definition": "precround(studenttinv(1-le/200,n-1),3)", "group": "Ungrouped variables"}, "that": {"name": "that", "description": "", "templateType": "anything", "definition": "if(mm[0]=0,' not significant and cannot reject the null hypothesis at the $\\\\var{le}$% level.', \n 'significant and can reject the null hypothesis at the $\\\\var{le}$% level.')\n ", "group": "Ungrouped variables"}, "n": {"name": "n", "description": "", "templateType": "anything", "definition": "random(10..40#2)", "group": "Ungrouped variables"}, "tr": {"name": "tr", "description": "", "templateType": "anything", "definition": "round(r11-st*sd/sqrt(n))+pert", "group": "Ungrouped variables"}, "tol": {"name": "tol", "description": "", "templateType": "anything", "definition": "0.001", "group": "Ungrouped variables"}, "mm": {"name": "mm", "description": "", "templateType": "anything", "definition": "switch(abs(test)<=st,[0,1],[1,0])", "group": "Ungrouped variables"}, "r11": {"name": "r11", "description": "", "templateType": "anything", "definition": "precround(mean(repeat(normalsample(mu,sd),n)),1)", "group": "Ungrouped variables"}, "test": {"name": "test", "description": "", "templateType": "anything", "definition": "precround((r11-tr)*sqrt(n)/sd,3)", "group": "Ungrouped variables"}, "mu": {"name": "mu", "description": "", "templateType": "anything", "definition": "random(50..80)", "group": "Ungrouped variables"}, "isthis": {"name": "isthis", "description": "", "templateType": "anything", "definition": "if(mm[0]=0,'is less than ',' is greater than ')", "group": "Ungrouped variables"}, "le": {"name": "le", "description": "", "templateType": "anything", "definition": "random(10,5,1,0.1)", "group": "Ungrouped variables"}, "sd": {"name": "sd", "description": "", "templateType": "anything", "definition": "random(5..12#0.2)", "group": "Ungrouped variables"}, "pert": {"name": "pert", "description": "", "templateType": "anything", "definition": "random(round(-2*st*sd/sqrt(n))..round(2*st*sd/sqrt(n)))", "group": "Ungrouped variables"}}, "type": "question", "showQuestionGroupNames": false, "preamble": {"js": "", "css": ""}, "advice": "

The test statistic is given by:

\n

\\[t = \\frac{\\bar{x}-\\mu}{\\frac{s}{\\sqrt{n}}}\\]

\n

and in this case we have:

\n

\\[t = \\frac{\\var{r11}-\\var{tr}}{\\frac{\\var{sd}}{\\sqrt{\\var{n}}}}=\\var{test}\\] to 3 decimal places.

\n

Now look up in the tables the critical value at $\\var{le}$% for $\\var{n}-1=\\var{n-1}$ degrees of freedom and a two-sided test.

\n

Note that as we are using one-sided tables we have to look at the $1-\\var{le}/200=\\var{1-le/200}$ critical value and find the corresponding value.

\n

In this case it is $\\var{st}$ to 3 decimal places.

\n

Since $\\var{abs(test)}$ {isthis} $\\var{st}$ we see that the result is {that}.

\n

 

", "statement": "

$X_1,\\;X_2,\\;\\dots, X_n$ is a random sample from $\\operatorname{N}(\\mu,\\sigma^2)$.

\n

The sample size is $n=\\var{n}$, with sample mean $\\bar{x}=\\var{r11}$ and $s=\\var{sd}$, the sample standard deviation.

\n

Suppose we wish to test at the $\\var{le}$% level the null hypothesis $H_0: \\mu=\\var{tr}$  versus a two sided alternative hypothesis. 

\n

 

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}