// Numbas version: exam_results_page_options {"variable_groups": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Classify described random variables as qualitative or quantitative, , ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"qual1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"Types of PC used by small businesses in the north-east\",\"Marital status of questionnaire respondents\",\"Month of the year in which small shops record their highest sales\",\"Type of tenure for those in the licensed trade business\",\"Subjects studied at A level by students in this class\"]", "description": "", "name": "qual1"}, "ind1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2*vector(ind)-vector(1,1,1)", "description": "", "name": "ind1"}, "ch1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(ind[0]=0,random(qual),random(quant))", "description": "", "name": "ch1"}, "ch2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(ind[1]=0,random(qual except ch1),random(quant except ch1))", "description": "", "name": "ch2"}, "qual": {"templateType": "anything", "group": "Ungrouped variables", "definition": "qual1+qual2", "description": "", "name": "qual"}, "quant2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"The number of people requiring a special in-flight meal\",\"The average volume of bottles of wine imported from South America\",\"Salaries of Newcastle University graduates six months after graduation\",\"The distance travelled by taxis for a particular cab firm every day\",\"Total annual sales for a large American departmental store\",\"The total cost of a student's text books for this semester\"]", "description": "", "name": "quant2"}, "ch3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(ind[2]=0,random(qual except [ch1,ch2]),random(quant except [ch1,ch2]))", "description": "", "name": "ch3"}, "qual2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"Ice cream flavour preferred by children\",\"Brand of sportswear preferred by athletes\",\"Favourite type of film by UK cinema-goers\",\"Mobile phone price-plan\",\"Shape of swimming pools in local authority-run leisure centres\"]", "description": "", "name": "qual2"}, "quant1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"The number of orders received by a catering company\",\"The height of students taking Statistics courses at Newcastle this year\", \"Your quarterly gas bill\", \"The time spent on hold at a credit call centre\",\"The average shipping time for orders placed with a TV shopping channel\",\"The annual electricity bill for a large UK Supermarket\"]", "description": "", "name": "quant1"}, "quant": {"templateType": "anything", "group": "Ungrouped variables", "definition": "quant1+quant2", "description": "", "name": "quant"}, "cind": {"templateType": "anything", "group": "Ungrouped variables", "definition": "-1*ind1", "description": "", "name": "cind"}, "ind": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random([[0,0,0],[1,0,0],[0,1,0],[0,0,1],[0,1,1],[1,0,1],[1,1,0],[1,1,1]])", "description": "", "name": "ind"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "transpose(matrix(list(cind),list(ind1)))", "description": "", "name": "m"}}, "ungrouped_variables": ["quant1", "quant2", "qual2", "cind", "qual1", "m", "ch1", "ch2", "ch3", "quant", "ind", "ind1", "qual"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"displayType": "radiogroup", "layout": {"type": "all", "expression": ""}, "choices": ["{ch1}", "{ch2}", "{ch3}"], "matrix": "m", "type": "m_n_x", "maxAnswers": 0, "shuffleChoices": true, "answers": ["Qualitative", "Quantitative"], "scripts": {}, "maxMarks": 0, "minAnswers": 0, "minMarks": 0, "shuffleAnswers": true, "showCorrectAnswer": true, "marks": 0, "warningType": "none"}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

State whether the following variables are Qualitative or Quantitative. 

\n

Note that you will be deducted one mark for every wrong choice. However the minimum mark is 0.

", "tags": ["ACE2013", "checked2015", "MAS1403", "MAS1604"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

01/02/2013:

\n

Finished first draft.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Choosing whether given random variables are qualitative or quantitative.

"}, "advice": ""}, {"name": "Classify sampling methods", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"displayType": "radiogroup", "layout": {"type": "all", "expression": ""}, "marks": 0, "choices": ["{ch1}", "{ch2}", "{ch3}"], "matrix": "w", "prompt": "\n

Identify each of the following scenarios as one of the following:

\n \n

Note that you will lose 1 mark for every incorrect answer, however the minimum mark for this part of the question is 0.

\n

 

\n ", "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "warningType": "none", "scripts": {}, "maxMarks": 0, "type": "m_n_x", "minMarks": 0, "shuffleAnswers": false, "showCorrectAnswer": true, "answers": ["Simple Random Sampling", "Stratified Sampling", "Systematic Sampling", "Judgemental Sampling"]}], "variables": {"w": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(switch(chlist[x]=0,[1,-1,-1,-1],chlist[x]=1,[-1,1,-1,-1],chlist[x]=2,[-1,-1,1,-1],[-1,-1,-1,1]),x,0..2)", "name": "w", "description": ""}, "ch3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(chlist[2]=0,random(a except [ch1,ch2]),chlist[2]=1,random(b except [ch1,ch2]),chlist[2]=2,random(c except [ch1,ch2]),random(d except [ch1,ch2]))", "name": "ch3", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\"A local bus company is planning a new route to serve four housing estates. Random samples of households are taken from each estate and sample members are asked to rate on a scale of 1 (strongly opposed) to 5 (strongly in favour) their reaction to the proposed service.\",\"A company has three divisions, and auditors are attempting to estimate the total amounts of the company's accounts receivable. Simple random samples of these accounts were taken for each of the three divisions.\",\"A company has three divisions, and auditors are attempting to estimate the total amounts of the company's accounts receivable. Simple random samples of these accounts were taken for each of the three divisions.\",\"This form of sampling reflects the major groupings within a population.\"]", "name": "b", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(switch(chlist[x]=0,[1,-1,-1],chlist[x]=1,[1,-1,-1],chlist[x]=2,[-1,1,-1],[-1,-1,1]),x,0..2)", "name": "v", "description": ""}, "d": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\"A company director believes she knows what characteristics make up the target population for a new product her company intends to launch. The company's team of market researchers check the viability of this new product by eliciting the opinions of the target population as specified by the director.\",\"Specific members of a population are sampled because of their known honesty and integrity.\",\"This form of sampling can provide a coherent and focussed sample by asking people with experience and relevant knowledge to provide their opinions.\",\"With this form of sampling, the researcher decides what he or she constitutes a representative sample.\"]", "name": "d", "description": ""}, "ch1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(chlist[0]=0,random(a),chlist[0]=1,random(b),chlist[0]=2,random(c),random(d))", "name": "ch1", "description": ""}, "ch2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(chlist[1]=0,random(a except ch1),chlist[1]=1,random(b except ch1),chlist[1]=2,random(c except ch1),random(d except ch1))", "name": "ch2", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\"One hundred small businesses in Newcastle are placed in alphabetical order and then numbered 1-100. The random number generator is then used to select twenty of these businesses.\",\"Under this form of sampling, if there are five hundred elements in the population, each element has a one-in-five hundred chance of being selected. \",\"One advantage of this form of sampling is that every element in the population has an equal chance of being selected.\",\"We are interested in the employment status of 25-40 year olds in South Tyneside. The names of all such people are obtained from the electoral roll and put into a hat; one hundred of these are then selected without replacement.\",\"One of six branches of a large retail outlet is to be selected for an audit. Each outlet is assigned a number from one to six, and then a fair, six-sided die is rolled to select the branch which will be audited.\"]", "name": "a", "description": ""}, "chlist": {"group": "Ungrouped variables", "templateType": "anything", "definition": "repeat(random(0,1,2,3),3)", "name": "chlist", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\"The first item to be checked for faults on a production line is chosen at random, thereafter, every 100th item is checked.\",\"A credit card company wants to investigate the spending habits if its customers. From its lists, the first customer is selected at random; thereafter, every 25th customer is selected.\",\"In an inquiry on heating costs, we decide to sample every 4th house on the street.\",\"To sample 1% of its target population, consisting of 5000 members, a market research company chooses the first member at random; after that, every 100th member is also selected.\",\"This form of sampling could produce an unrepresentative sample because of patterns in the sampling frame.\"]", "name": "c", "description": ""}}, "ungrouped_variables": ["a", "c", "b", "d", "chlist", "ch1", "ch2", "ch3", "w", "v"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\n

Answer the following questions on the sampling methods used in these situations.

\n

 

\n ", "tags": ["ACE2013", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "

Deciding whether or not three sampling methods are simple random sampling, stratified sampling, systematic or judgemental sampling. 

"}, "advice": "", "showQuestionGroupNames": false}, {"name": "Find mean, standard deviation, median and interquartile range of sample, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"av": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r),2)", "description": "", "name": "av"}, "sig": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4#0.2)", "description": "", "name": "sig"}, "std": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r,true),2)", "description": "", "name": "std"}, "these": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'specialist camera equipment'", "description": "", "name": "these"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(n=2,12,random(7,5))", "description": "", "name": "m"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'an online warehouse' ", "description": "", "name": "this"}, "med": {"templateType": "anything", "group": "Ungrouped variables", "definition": "median(r)", "description": "", "name": "med"}, "tble1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(repeat(max(round(normalsample(me,sig)),random(4..6)),m),n)", "description": "", "name": "tble1"}, "whatever": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'number of orders per ' + period", "description": "", "name": "whatever"}, "interq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(uquartile(r)-lquartile(r),2)", "description": "", "name": "interq"}, "shortform": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'orders'", "description": "", "name": "shortform"}, "r": {"templateType": "anything", "group": "Ungrouped variables", "definition": "flattenint(tble1)", "description": "", "name": "r"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "name": "n"}, "tble": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(n=2,map(['Year '+x+':']+tble1[x-1],x,1..2),map(['Week '+ x+':']+tble1[x-1],x,1..3))", "description": "", "name": "tble"}, "units": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'over a '+ n + ' '+p+ ' period,'", "description": "", "name": "units"}, "note": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(mean(r)=av,' ','Note that we used the more accurate value $(\\\\var{mean(r)})^2$ for $\\\\bar{x}^2$.')", "description": "", "name": "note"}, "me": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(7..12)", "description": "", "name": "me"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(m=12,'year','week')", "description": "", "name": "p"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(m=12,[' ','J','F','M','A','M','J','J','A','S','O','N','D'],m=5,[' ','M','T','W','T','F'],[' ','M','T','W','T','F','S','S'])", "description": "", "name": "t"}, "period": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(m=7,'day',m=12,'month',m=5,'weekday')", "description": "", "name": "period"}}, "ungrouped_variables": ["me", "tble1", "tble", "p", "shortform", "med", "this", "m", "interq", "whatever", "n", "note", "these", "std", "r", "sig", "t", "av", "units", "period"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"flattenint": {"type": "list", "language": "javascript", "definition": "/*only for integer arrays*/ \n array.toString().split(',').forEach( function (item, i) \n {array[i] = parseInt(item);\n }\n ); \n return array;", "parameters": [["array", "list"]]}, "uquartile": {"type": "number", "language": "jme", "definition": "interpolate(a,3*(length(a)+1)/4)", "parameters": [["a", "list"]]}, "interpolate": {"type": "number", "language": "jme", "definition": "(1-fract(r))*sort(a)[floor(r)-1]+fract(r)*sort(a)[ceil(r)-1]", "parameters": [["a", "list"], ["r", "number"]]}, "lquartile": {"type": "number", "language": "jme", "definition": "interpolate(a,(length(a)+1)/4)", "parameters": [["a", "list"]]}}, "showQuestionGroupNames": false, "parts": [{"prompt": "

Sample mean = [[0]]{shortform}. Give your answer to  $2$ decimal places (include trailing zeros if required).

\n

Sample Standard Deviation = [[1]] {shortform}. Give your answer to $2$ decimal places (include trailing zeros if required).

\n

Sample Median = [[2]] (Input as an exact decimal).

\n

The interquartile range= [[3]] (Input as an exact decimal).

", "scripts": {}, "gaps": [{"precisionPartialCredit": 0, "allowFractions": false, "correctAnswerFraction": false, "minValue": "av-0.01", "maxValue": "av+0.01", "precision": "2", "type": "numberentry", "precisionType": "dp", "showPrecisionHint": false, "strictPrecision": false, "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"precisionPartialCredit": 0, "allowFractions": false, "correctAnswerFraction": false, "minValue": "std-0.01", "maxValue": "std+0.01", "precision": "2", "type": "numberentry", "precisionType": "dp", "showPrecisionHint": false, "strictPrecision": false, "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "med", "minValue": "med", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}, {"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "interq", "minValue": "interq", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}], "statement": "

The following data are the {whatever} for {these}, {units} taken by {this}

\n

{table(tble,t)}

\n

Answer the following questions:

\n

 

\n

 

", "tags": ["ACE2013", "checked2015", "interquartile range", "lower quartile", "MAS1403", "mean", "mean ", "median", "quartiles", "sample data", "sample mean", "sample standard deviation", "standard deviation", "statistics", "upper quartile"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

Note that the uquartile and lquartile are calculated as given by the functions below these may change!

\n

 21/12/2012:

\n

Three user defined functions. Added tag udf.

\n

flattenint, takes an array of arrays with integers leaves and converts to an integer array by flattening the array. Other two functions, uquartile and lquartile find the lower and upper quartiles.

\n

Scenarios possible, added sc.

\n

22/10/2013:

\n


Redefined functions uquartile and lquartile to fit new definitions. Added helper udf interpolate.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Given sample data find mean, standard deviation, median, interquartile range,

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

As we have to find the median and the interquartile range it is a good idea to order the data and also to total up the data (for the mean) and find the total of the squares of the data (for the variance).

\n

{table([['Data']+sort(r),['Squared data']+map(x^2,x,sort(r)),['Index']+map(x,x,1..m*n)],[])}

\n

Note that from the above table:

\n

$n=\\var{m*n}$.

\n

$\\displaystyle  \\sum x_i = \\var{sum(r)}$ and 

\n

$\\displaystyle  \\sum x^2_i = \\var{sum(map(x^2,x,r))}$ .

\n

The sample mean is $\\bar{x}=\\displaystyle \\frac{ \\sum x_i}{n}=\\frac{\\var{sum(r)}}{\\var{m*n}}=\\var{mean(r)}=\\var{av}$ to 2 decimal places.

\n

The sample deviation is the square root of the sample variance.

\n

Sample variance:\\[\\begin{eqnarray*}\\frac{1}{ n -1}\\left(\\sum x_i ^ 2 - n \\bar{x} ^ 2\\right)&=& \\frac{1}{\\var{m*n-1}}\\left(\\var{sum(map(x^2,x,r))}-\\var{m*n}\\times\\var{mean(r)^2}\\right)\\\\&=&\\var{variance(r,true)}\\end{eqnarray*}\\] {Note} 

\n

So the sample standard deviation = $\\sqrt{\\var{variance(r,true)}}=\\var{std}$ to 2 decimal places.

\n

The median is $\\var{median(r)} $.

\n

The lower quartile is : $\\var{lquartile(r)}$.

\n

The upper quartile is : $\\var{uquartile(r)}$.

\n

The interquartile range is the difference between these quartiles =$\\var{uquartile(r)}-\\var{lquartile(r)}=\\var{uquartile(r)-lquartile(r)}$

\n

 

\n

 

"}, {"name": "Find probabilities from 2D frequency table, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"w": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..6)", "name": "w", "description": ""}, "cat": {"group": "Ungrouped variables", "templateType": "anything", "definition": "['single','married','divorced','widowed']", "name": "cat", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..6)", "name": "v", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[[round(tc1/random(7.5..8.5#0.1)),0,round(tc1/random(6.5..7.5#0.1)),round(tc1/random(19.5..20.5#0.1))],[round(tc2/random(3.5..4.5#0.1)),0,round(tc2/random(19.5..20.5#0.1)),round(tc2/random(19.5..20.5#0.1))],[round(tc3/random(2.5..3.5#0.1)),0,random(5..15),round(tc3/random(14.5..15.5#0.1))]]", "name": "a", "description": ""}, "w1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..6)", "name": "w1", "description": ""}, "tc2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "n-tc1-tc3", "name": "tc2", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..3)", "name": "t", "description": ""}, "tc3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(n/random(6.5..7.5#0.1))", "name": "tc3", "description": ""}, "sumr": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(sum(list(r[y])),y,0..3)", "name": "sumr", "description": ""}, "oneof": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(v=1,cat[0]+\" or \"+ cat[1] ,v=2,cat[0]+\" or \"+cat[2],v=3,cat[0]+\" or \"+cat[3],v=4,cat[1]+\" or \"+cat[2],v=5,cat[1]+\" or \"+cat[3],cat[2]+\" or \"+cat[3])", "name": "oneof", "description": ""}, "othercats": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(t=0,cat[1]+\" or \"+ cat[2] ,t=1,cat[0]+\" or \"+cat[3],t=2,cat[0]+\" or \"+cat[1],t=3,cat[0]+\" or \"+cat[2],cat[0]+\" or \"+cat[2])", "name": "othercats", "description": ""}, "ans": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(precround(x,3),x,[sumr[t]/n,tc[u]/n,ve/n,1-tc[u]/n,ce1/n,ce2/n,sumr[t]*(sumr[t]-1)/(n*(n-1)),tc[u1]*(tc[u1]-1)/(n*(n-1)),r[t][u]/tc[u],we2/tc[u]])", "name": "ans", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1200..2300#2)", "name": "n", "description": ""}, "tc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[tc1,tc2,tc3]", "name": "tc", "description": ""}, "at": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\"teetotal\",\"drinking 1-20 units/week\",\"drinking 21+ units/week\"]", "name": "at", "description": ""}, "we2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=0, if(t=0,r[1][0]+r[2][0], if(t=1,r[0][0]+r[3][0], if(t=2,r[0][0]+r[1][0],r[0][0]+r[2][0]))),if(u=1, if(t=0,r[1][1]+r[2][1], if(t=1,r[0][1]+r[3][1], if(t=2,r[0][1]+r[1][1],r[0][1]+r[2][1]))),if(t=0,r[1][2]+r[2][2], if(t=1,r[0][2]+r[3][2], if(t=2,r[0][2]+r[1][2], r[0][2]+r[2][2])))))", "name": "we2", "description": ""}, "u1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..2)", "name": "u1", "description": ""}, "ce1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(w=1, r[0][0],w=2, r[0][1],w=3, r[0][2],w=4,r[1][0],w=5, r[1][1],r[1][2])", "name": "ce1", "description": ""}, "ce2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(w1=1, r[2][0],w1=2, r[2][1],w1=3, r[2][2],w1=4,r[3][0],w1=5, r[3][1],r[3][2])", "name": "ce2", "description": ""}, "drk1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "At[u1]", "name": "drk1", "description": ""}, "tc1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(n/random(2.5..3.5#0.1))", "name": "tc1", "description": ""}, "tot": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sum(tc)", "name": "tot", "description": ""}, "things": {"group": "Ungrouped variables", "templateType": "anything", "definition": "\"male\"", "name": "things", "description": ""}, "cats": {"group": "Ungrouped variables", "templateType": "anything", "definition": "\"Marital Status\"", "name": "cats", "description": ""}, "catattrib1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(w=1,cat[0]+\" and \"+At[0],w=2,cat[0]+\" and \"+At[1],w=3,cat[0]+\" and \"+At[2],w=4,cat[1]+\" and \"+At[0],w=5,cat[1]+\" and \"+At[1],cat[1]+\" and \"+At[2])", "name": "catattrib1", "description": ""}, "ve": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(v=1,sumr[0]+ sumr[1] ,v=2,sumr[0]+sumr[2],v=3,sumr[0]+sumr[3],v=4,sumr[1]+sumr[2],v=5,sumr[1]+sumr[3],sumr[2]+sumr[3])", "name": "ve", "description": ""}, "this": {"group": "Ungrouped variables", "templateType": "anything", "definition": "\"alcohol consumption\"", "name": "this", "description": ""}, "catattrib2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(w1=1,cat[2]+\" and \"+At[0],w1=2,cat[2]+\" and \"+At[1],w1=3,cat[2]+\" and \"+At[2],w1=4,cat[3]+\" and \"+At[0],w1=5,cat[3]+\" and \"+At[1],cat[3]+\" and \"+At[2])", "name": "catattrib2", "description": ""}, "somecat": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cat[t]", "name": "somecat", "description": ""}, "drkpair": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(u=0,\"drinks alcohol\",u=1,At[0]+' or ' + At[2],At[0]+\" or \" +At[1])", "name": "drkpair", "description": ""}, "r": {"group": "Ungrouped variables", "templateType": "anything", "definition": "transpose(matrix(map(norm(a[y],1,tc[y]),y,0..2)))", "name": "r", "description": ""}, "drk": {"group": "Ungrouped variables", "templateType": "anything", "definition": "At[u]", "name": "drk", "description": ""}, "u": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..2)", "name": "u", "description": ""}}, "ungrouped_variables": ["somecat", "ve", "othercats", "at", "ce1", "ans", "cat", "drk1", "things", "u1", "tot", "catattrib2", "cats", "tc", "w1", "oneof", "tc2", "tc3", "tc1", "catattrib1", "a", "drkpair", "this", "n", "we2", "drk", "r", "u", "t", "w", "v", "sumr", "ce2"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {"norm": {"type": "list", "language": "javascript", "definition": "\n var b=a;\n var s=-b[x];\n for(i=0;iFind the following probabilities that a randomly chosen {things} involved in this survey:(Enter all probabilities to 3 decimal places).

\n

1) is {somecat}: Probability =? [[0]]

\n

2) is {drk}:  Probability = ? [[1]]

\n

3) is either {oneof}: Probability =? [[2]]

\n

4) {drkpair}: Probability =? [[3]]

\n

5) {catattrib1}: Probability =? [[4]]

\n

6) {catattrib2}: Probability=? [[5]]

\n ", "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans[6]", "minValue": "ans[6]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans[7]", "minValue": "ans[7]", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n

Find the probability (to 3 decimal places) that two randomly selected {things}s in this survey are

\n

7) both {somecat}:  Probability = ? [[0]]

\n

8) both {drk1}: Probability =? [[1]]

\n ", "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans[8]", "minValue": "ans[8]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans[9]", "minValue": "ans[9]", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n

Given that a randomly selected {things} in this survey is {drk}, what is the probability that he:

\n

9) is {somecat}: Probability = ? [[0]]

\n

10) is {othercats}: Probability =? [[1]]

\n

 

\n ", "marks": 0}], "statement": "\n

A survey was conducted to obtain information on {this}. A random sample of {things}s gave :

\n

 

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{Cats}{At[0]}{At[1]}{At[2]}Total
{cat[0]}{r[0][0]}{r[0][1]}{r[0][2]}{sumr[0]}
{cat[1]}{r[1][0]}{r[1][1]}{r[1][2]}{sumr[1]}
{cat[2]}{r[2][0]}{r[2][1]}{r[2][2]}{sumr[2]}
{cat[3]}{r[3][0]}{r[3][1]}{r[3][2]}{sumr[3]}
Totals{tc[0]}{tc[1]}{tc[2]}{tot}
\n \n ", "tags": ["ACE2013", "checked2015", "MAS1403"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t

29/12/2012:

\n \t\t

Added tags and description.

\n \t\t

This is easily configurable to other surveys by changing the variables used for labelling. Added the tag sc to denote this. Also added tag, table, as there is a table included.

\n \t\t

The column labels in the table need to be centred.

\n \t\t

The presentation and layout of the questions should be improved and made consistent.

\n \t\t

There is a user-defined function norm(a,x,n) which takes a numeric list a and changes the entry a[x] so that the sum of entries in a is n. Added the tag udf. 

\n \t\t

Calculations correct on testing.

\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Finding probabilities from a survey giving a table of data on the alcohol consumption of males. This can be easily adapted to data from other types of surveys.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n

1) The total number of {somecat} {things}s is $\\var{sumr[t]}$ hence the probability that a random {things} from this survey is {somecat} is $\\displaystyle \\frac{ \\var{sumr[t]}}{\\var{n}}=\\var{ans[0]}$ to 3 decimal places.

\n

 

\n

2) The total number of  {things}s who are {drk} is $\\var{tc[u]}$ hence the probability that a random {things} from this survey is {drk} is $\\displaystyle \\frac{ \\var{tc[u]}}{\\var{n}}=\\var{ans[1]}$  to 3 decimal places.

\n

 

\n

3) Looking at the table there are $\\var{ve}$ {things}s that are {oneof}. Hence the probability is $\\displaystyle \\frac{ \\var{ve}}{\\var{n}}=\\var{ans[2]}$  to 3 decimal places.

\n

 

\n

4) These are the {things}s that are not {drk}, and hence there are $\\var{n}-\\var{tc[u]}=\\var{n-tc[u]}$ of them (see answer to part b)), and the probability of randomly selecting one is  $\\displaystyle \\frac{ \\var{n-tc[u]}}{\\var{n}}=\\var{ans[3]}$ to 3 decimal places.

\n

 

\n

5)Looking at the table we see that the number corresponding to {catattrib1} is $\\var{ce1}$. Hence the probability of randomly selecting one is $\\displaystyle \\frac{ \\var{ce1}}{\\var{n}}=\\var{ans[4]}$ to 3 decimal places.

\n

6) As in the last question, looking at the table we see that the number corresponding to {catattrib2} is $\\var{ce2}$. Hence the probability of randomly selecting one is $\\displaystyle \\frac{ \\var{ce2}}{\\var{n}}=\\var{ans[5]}$ to 3 decimal places.

\n

 

\n

7) We know from question a) that the probability of selecting a {somecat} {things} is,  $\\displaystyle \\frac{ \\var{sumr[t]}}{\\var{n}}$, after this we now have $\\var{sumr[t]-1} $ {somecat} {things}s amongst the $\\var{n-1}$  left,  and the probability of yet again selecting one  of these is $\\displaystyle \\frac{ \\var{sumr[t]-1}}{\\var{n-1}}$. So the probability of selecting two is  $\\displaystyle \\frac{ \\var{sumr[t]}\\times  \\var{sumr[t]-1}}{\\var{n}\\times\\var{n-1}}=\\var{ans[6]}$ to 3 decimal places.

\n

8) The probability of selecting a {things} who is {drk1} is $\\displaystyle \\frac{ \\var{tc[u1]}}{\\var{n}}$, after this we now have  $\\var{tc[u1]-1}$ {drk1} {things}s amongst the $\\var{n-1}$ left, and the probability of yet again selecting one  of these is $\\displaystyle \\frac{ \\var{tc[u1]-1}}{\\var{n-1}}$. So the probability of selecting two is  $\\displaystyle \\frac{ \\var{tc[u1]}\\times  \\var{tc[u1]-1}}{\\var{n}\\times\\var{n-1}}=\\var{ans[7]}$ to 3 decimal places.

\n

9) Since there are $\\var{r[t][u]}$ {somecat} {things}s from the  $\\var{tc[u]}$ {things}s that are {drk} the probability of selecting one  is $\\displaystyle \\frac{\\var{r[t][u]}}{\\var{tc[u]}}= \\var{ans[8]}$ to 3 decimal places.

\n

10) Since there are $\\var{we2}$ {othercats} {things}s from the $\\var{tc[u]}$ {things}s that are {drk} the probability of selecting one  is $\\displaystyle \\frac{\\var{we2}}{\\var{tc[u]}}= \\var{ans[9]}$   to 3 decimal places.

\n "}, {"name": "Find z-score for sample and calculate confidence interval", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"expb": {"group": "Ungrouped variables", "templateType": "anything", "definition": "'Not at all important'", "name": "expb", "description": ""}, "top": {"group": "Ungrouped variables", "templateType": "anything", "definition": "7", "name": "top", "description": ""}, "score": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..5#0.1)", "name": "score", "description": ""}, "sstdev": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.9..2.0#0.01)", "name": "sstdev", "description": ""}, "upperbound": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(samplemean+1.96*sstdev/sqrt(samplesize),3)", "name": "upperbound", "description": ""}, "these": {"group": "Ungrouped variables", "templateType": "anything", "definition": "'UK shoppers'", "name": "these", "description": ""}, "zscore": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround((score-samplemean)/sstdev,3)", "name": "zscore", "description": ""}, "this": {"group": "Ungrouped variables", "templateType": "anything", "definition": "'the importance of price when making food choice decisions'", "name": "this", "description": ""}, "expt": {"group": "Ungrouped variables", "templateType": "anything", "definition": "'Extremely important'", "name": "expt", "description": ""}, "samplemean": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(4.5..6.5#0.01)", "name": "samplemean", "description": ""}, "samplesize": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1000", "name": "samplesize", "description": ""}, "bottom": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1", "name": "bottom", "description": ""}, "lowerbound": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(samplemean-1.96*sstdev/sqrt(samplesize),3)", "name": "lowerbound", "description": ""}}, "ungrouped_variables": ["zscore", "lowerbound", "bottom", "this", "top", "upperbound", "samplemean", "these", "sstdev", "score", "samplesize", "expb", "expt"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {}, "parts": [{"prompt": "\n\t\t\t

What is the $z$-score for a score of $\\var{score}$?

\n\t\t\t

\n\t\t\t

Enter your answer to 3 decimal places.

\n\t\t\t", "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "zscore-0.001", "showCorrectAnswer": true, "marks": 2, "maxValue": "zscore+0.001"}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "lowerbound-0.001", "showCorrectAnswer": true, "marks": 1, "maxValue": "lowerbound+0.001"}, {"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "upperbound-0.001", "showCorrectAnswer": true, "marks": 1, "maxValue": "upperbound+0.001"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n\t\t\t

Calculate the $95$% confidence interval for the population mean $\\mu$:

\n\t\t\t

Lower bound: [[0]]

\n\t\t\t

Upper bound: [[1]]

\n\t\t\t

\n\t\t\t

Enter your answers to 3 decimal places.

\n\t\t\t", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\n\t

A recent survey asked $\\var{samplesize}$ {these} to rate {this} on a scale from $\\var{bottom}$ ({expb}) to $\\var{top}$ ({expt}).

\n\t

The mean rating was $\\var{samplemean}$ with SD $\\var{sstdev}$.

\n\t

\n\t

Enter all values to 3 decimal places.

\n\t

\n\t", "tags": ["95%", "ACE2013", "checked2015", "confidence interval", "mean", "mean ", "population mean", "sample", "sample mean", "scale", "standard deviation", "statistics", "z-score"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n\t\t

17/10/2013:

\n\t\t


Created question.

\n\t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "\n\t\t

Given mean and sd of 1000 sample returns on a scale of 1 to 7 together with a given score, find the z-score.

\n\t\t

Also find the 95% confidence interval for the population mean.

\n\t\t"}, "advice": "\n\t

a)

\n\t

The $z$-score is given by 

\n\t

\\[z=\\frac{\\var{score}-\\var{samplemean}}{\\var{sstdev}}=\\var{zscore}\\]

\n\t

(To 3 decimal places).

\n\t

b)

\n\t

The lower bound for the 95% confidence interval is given by:

\n\t

Lower bound = $\\displaystyle \\var{samplemean}-1.96 \\times \\frac{ \\var{sstdev}}{\\sqrt{\\var{samplesize}}}=\\var{lowerbound}$

\n\t

\n\t

Upper bound = $\\displaystyle \\var{samplemean}+1.96 \\times \\frac{ \\var{sstdev}}{\\sqrt{\\var{samplesize}}}=\\var{upperbound}$

\n\t

(Both to 3 decimal places.)

\n\t

Hence for the population mean $\\mu$  we can say that $\\var{lowerbound} \\le\\mu \\le \\var{upperbound}$ with $95$% confidence.

\n\t"}, {"name": "Probability sample mean is within d of the population mean", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"thismany1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[1]", "name": "thismany1", "description": ""}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(prob1 > 0.95,[1,0,0,0], prob2>0.95,[0,1,0,0],prob3>0.95,[0,0,1,0],[0,0,0,1])", "name": "mm", "description": ""}, "message": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(prob1>=0.95, \"We take a sample of size \"+ thismany1+ \" as the probability in this case is $\\\\ge 0.95.$\",\nprob2>=0.95, \"We take a sample of size \"+ thismany2+ \" as the probability in this case is $\\\\ge 0.95.$\", \nprob3>=0.95, \"We take a sample of size \"+ thismany3+ \" as the probability in this case is $\\\\ge 0.95$.\",\n \"None of the probabilities is $\\\\ge 0.95$ so we need to take a larger sample.\")", "name": "message", "description": ""}, "popstdev": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[0]", "name": "popstdev", "description": ""}, "prob3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-2*normalcdf(-thismany3^0.5*thismuch/popstdev,0,1),3)", "name": "prob3", "description": ""}, "thismany3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[3]", "name": "thismany3", "description": ""}, "prob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-2*normalcdf(-thismany1^0.5*thismuch/popstdev,0,1),3)", "name": "prob1", "description": ""}, "these": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('petrol stations')", "name": "these", "description": ""}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('price')", "name": "this", "description": ""}, "thismuch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[5]", "name": "thismuch", "description": ""}, "thismany2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[2]", "name": "thismany2", "description": ""}, "prob2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-2*normalcdf(-thismany2^0.5*thismuch/popstdev,0,1),3)", "name": "prob2", "description": ""}, "units": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'pounds'", "name": "units", "description": ""}, "popmean": {"templateType": "anything", "group": "Ungrouped variables", "definition": "generateprobs[4]", "name": "popmean", "description": ""}, "that": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('unleaded petrol in the UK per litre in 2013')", "name": "that", "description": ""}, "generateprobs": {"templateType": "anything", "group": "Ungrouped variables", "definition": "satisfy(\n [popstdev,thismany1,thismany2,thismany3,popmean,thismuch],\n [random(0.08..0.12#0.02),random(15..30#5),random(40..55#5),random(80..100#10),\n random(1.25..1.35#0.01),random(0.02..0.06)],\n [precround(1-2*normalcdf(-thismany1^0.5*thismuch/popstdev,0,1),3)<>0.95,\n precround(1-2*normalcdf(-thismany2^0.5*thismuch/popstdev,0,1),3)<>0.95,\n precround(1-2*normalcdf(-thismany3^0.5*thismuch/popstdev,0,1),3)<>0.95],\n 1000\n )\n \n \n ", "name": "generateprobs", "description": ""}}, "ungrouped_variables": ["these", "generateprobs", "that", "this", "popstdev", "thismany2", "mm", "thismany1", "thismany3", "units", "popmean", "message", "thismuch", "prob2", "prob3", "prob1"], "rulesets": {}, "functions": {}, "showQuestionGroupNames": false, "parts": [{"showCorrectAnswer": true, "correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "prob1+0.001", "minValue": "prob1-0.001", "prompt": "

What is the probability that the mean {this} taken from a sample of $\\var{thismany1}$ {these} is within $\\var{thismuch}$ {units} of the population mean?

\n

Input the probability to 3 decimal places.

", "marks": 1}, {"showCorrectAnswer": true, "correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "prob2+0.001", "minValue": "prob2-0.001", "prompt": "

What is the probability that the mean {this} taken from a sample of $\\var{thismany2}$ {these} is within $\\var{thismuch}$ {units} of the population mean?

\n

Input the probability to 3 decimal places.

", "marks": 1}, {"showCorrectAnswer": true, "correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "prob3+0.001", "minValue": "prob3-0.001", "prompt": "

What is the probability that the mean {this} taken from a sample of $\\var{thismany3}$ {these} is within $\\var{thismuch}$ {units} of the population mean?

\n

Input the probability to 3 decimal places.

", "marks": 1}, {"displayType": "radiogroup", "choices": ["

{thismany1}

", "

{thismany2}

", "

{thismany3}

", "

Increase the sample size

"], "displayColumns": 0, "prompt": "

Given the probabilities you have found, what sample size would you recommend to have at least a $0.95$ probability that the sample mean is within $\\var{thismuch}$ {units} of the population mean?

", "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "maxMarks": 0, "type": "1_n_2", "minMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}], "statement": "

The population mean of the {this} of {that} is $\\var{popmean}$ {units} with population standard deviation $\\var{popstdev}$ {units}.

\n

Find the following probabilities.

\n

Input all probabilities to 3 decimal places.

\n

", "tags": ["ACE2013", "checked2015", "mean", "mean ", "normal distribution", "Normal distribution", "Probability", "probability", "sampling", "satisfy", "standard deviation", "statistics", "z score"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

There are variables set up to set up different scenarios. Present one is price of unleaded petrol in the UK.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Given data on population mean and population standard deviation and three sampling sizes, calculate the probabilities that the sample means are within a specified distance from the population mean.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

Let $M$ be the mean price of the sample

\n

Converting to $N(0,1)$ we see that we require the probability that if $\\displaystyle Z=\\frac{|M-\\var{popmean}|}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany1}}}}$ then we require the probability that \\[\\frac{-\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany1}}}} \\lt Z \\lt \\frac{\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany1}}}} \\implies \\var{-thismany1^0.5*thismuch/popstdev}\\lt Z \\lt \\var{thismany1^0.5*thismuch/popstdev}\\].

\n

The probability that $Z \\lt \\var{-thismany1^0.5*thismuch/popstdev}$ is $p=\\var{normalcdf(-thismany1^0.5*thismuch/popstdev,0,1)}$.

\n

Hence the probability we want is $P_1=1-2p=\\var{prob1}$ to 3 decimal places.

\n

b)

\n

Similarly we have for sample size $\\var{thismany2}$ we want the probability that:

\n

\\[\\frac{-\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany2}}}} \\lt Z \\lt \\frac{\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany2}}}} \\implies \\var{-thismany2^0.5*thismuch/popstdev}\\lt Z \\lt \\var{thismany2^0.5*thismuch/popstdev}\\].

\n

The probability that $Z \\lt \\var{-thismany2^0.5*thismuch/popstdev}$ is $p=\\var{normalcdf(-thismany2^0.5*thismuch/popstdev,0,1)}$.

\n

Hence the probability we want is $P_2=1-2p=\\var{prob2}$ to 3 decimal places.

\n

c)

\n

For sample size $\\var{thismany3}$ we want the probability that:

\n

\\[\\frac{-\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany3}}}} \\lt Z \\lt \\frac{\\var{thismuch}}{\\frac{\\var{popstdev}}{\\sqrt{\\var{thismany3}}}} \\implies \\var{-thismany3^0.5*thismuch/popstdev}\\lt Z \\lt \\var{thismany3^0.5*thismuch/popstdev}\\].

\n

The probability that $Z \\lt \\var{-thismany3^0.5*thismuch/popstdev}$ is $p=\\var{normalcdf(-thismany3^0.5*thismuch/popstdev,0,1)}$.

\n

Hence the probability we want is $P_3=1-2p=\\var{prob3}$ to 3 decimal places.

\n

d) {message}

"}, {"name": "Find a confidence interval for the population mean with variance unknown, , ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "tags": ["checked2015"], "metadata": {"description": "

Finding the confidence interval at either 90%, 95% or 99% for the mean given the mean and standard deviation of a sample. The population variance is not given and so the t test has to be used. Various scenarios are included.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The management of {sc[s]} wants to {dothis[s]}.

\n

A random sample of {spec} $\\var{n}$ {t[s]} gave a mean and standard deviation of {p}$\\var{m[s]}$ {units} and {p}$\\var{sd[s]}$ {units} respectively.

", "advice": "

1.

\n

The population variance is unknown. So we have to use the t tables to find the confidence interval.

\n

2.

\n

We now calculate the $\\var{confl}$ confidence interval:

\n

As we have $\\var{n}-1=\\var{n-1}$ degrees of freedom, the interval is given by:

\n

\\[ \\var{m[s]} \\pm t_{\\var{n-1}}\\sqrt{\\frac{\\var{sd[s]}^2}{\\var{n}}}\\]

\n

Looking up the t tables for $\\var{confl}$% we see that $t_{\\var{n-1}}=\\var{invt}$ to 3 decimal places.

\n

Hence:

\n

Lower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{invt} \\sqrt{\\frac{\\var{sd[s]} ^ 2} {\\var{n}}} =\\var{p} \\var{lci}$ {units} to 2 decimal places.

\n

Upper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{invt} \\sqrt{\\frac{\\var{sd[s]} ^ 2} {\\var{n}}} = \\var{p}\\var{uci}$ {units} to 2 decimal places.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"s": {"name": "s", "group": "Ungrouped variables", "definition": "random(0..abs(sc)-1)", "description": "", "templateType": "anything", "can_override": false}, "sc1ch": {"name": "sc1ch", "group": "Ungrouped variables", "definition": "random(\"hotels\",\"motels\", \"Bed and Breakfasts\",\"budget hotels\")", "description": "", "templateType": "anything", "can_override": false}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "\n [\"a national chain of \"+ sc1ch,\n \"a \"+sc2ch + \" chain of clothing shops \",\n \" a large factory \",\n \" a regional passenger airline in \"+sc4ch,\n \"Choclastic!, a company producing a variety of chocolate bars \",\n \" a large bakery \"]\n ", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "\n [\"vacated rooms was inspected by the management and this\",\n \"clothing outlets \",\n \"workers\",\n \"tickets \",\n \"chocolate bars \",\n sc6ch+\" \"]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "sc4ch": {"name": "sc4ch", "group": "Ungrouped variables", "definition": "random(\"the Caribbean\",\"the Mediterranean\",\"North East England\",\"South West England\",\"California\")", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(10..30)", "description": "", "templateType": "anything", "can_override": false}, "sc2ch": {"name": "sc2ch", "group": "Ungrouped variables", "definition": "random(\"local\",\"national\")", "description": "", "templateType": "anything", "can_override": false}, "dothis": {"name": "dothis", "group": "Ungrouped variables", "definition": "\n [\"estimate the mean cost per room of repairing damage caused by its customers during a bank holiday weekend\",\n \"estimate the mean monthly sales of all of its outlets\",\n \"estimate the mean hours worked per week of all its employees\",\n \"estimate the mean cost of a ticket on its most popular route\",\n \"estimate the mean weight of \"+sc5ch+\" inside bars of its most popular product\",\n \"estimate the mean amount of saturated fat in its \"+ sc6ch]\n \n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "invt": {"name": "invt", "group": "Ungrouped variables", "definition": "precround(tinvt,3)", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "switch(s=0 or s=1 or s=3,'\u00a3',' ')", "description": "", "templateType": "anything", "can_override": false}, "sc5ch": {"name": "sc5ch", "group": "Ungrouped variables", "definition": "random(\"caramel\",\"Turkish delight\",\"honeycomb\",\"nuts\")", "description": "", "templateType": "anything", "can_override": false}, "sc6ch": {"name": "sc6ch", "group": "Ungrouped variables", "definition": "random(\"Cornish pasties\",\"sausage rolls\",\"chicken pies\",\"minced beef pasties\")", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "\n [random(30..100#0.01),\n random(40000..80000#500),\n random(34..48#0.01),\n random(100..300#0.01),\n random(10..20#0.01),\n random(3.5..6#0.01)]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "lci": {"name": "lci", "group": "Ungrouped variables", "definition": "precround(tlci,2)", "description": "", "templateType": "anything", "can_override": false}, "uci": {"name": "uci", "group": "Ungrouped variables", "definition": "precround(tuci,2)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "switch(s=2,\"hours\",s=4,\"g\",s=5,\"g per 100g\",\" \")", "description": "", "templateType": "anything", "can_override": false}, "tuci": {"name": "tuci", "group": "Ungrouped variables", "definition": "m[s]+invt*sqrt(sd[s]^2/n)", "description": "", "templateType": "anything", "can_override": false}, "sd": {"name": "sd", "group": "Ungrouped variables", "definition": "\n [random(3..10#0.01),\n random(500..4000#0.5),\n random(2..5#0.01),\n random(10..40#0.01),\n random(1..3#0.01),\n random(0.5..1#0.01)]\n ", "description": "", "templateType": "anything", "can_override": false}, "tlci": {"name": "tlci", "group": "Ungrouped variables", "definition": "m[s]-invt*sqrt(sd[s]^2/n)", "description": "", "templateType": "anything", "can_override": false}, "spec": {"name": "spec", "group": "Ungrouped variables", "definition": "if(s=2,\"the timecards of \", \" \")", "description": "", "templateType": "anything", "can_override": false}, "tinvt": {"name": "tinvt", "group": "Ungrouped variables", "definition": "studenttinv((confl+100)/200,n-1)", "description": "", "templateType": "anything", "can_override": false}, "confl": {"name": "confl", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["m", "uci", "invt", "units", "lci", "spec", "sc2ch", "sc1ch", "tinvt", "confl", "tuci", "dothis", "sc4ch", "sc6ch", "n", "p", "s", "tlci", "t", "sc", "sc5ch", "sd"], "variable_groups": [], "functions": {"pounds": {"parameters": [["n", "number"]], "type": "number", "language": "javascript", "definition": "return Numbas.util.currency(n,'\u00a3','p');"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is the population variance known or unknown?

\n

[[0]]

\n

Calculate a $\\var{confl}$% confidence interval $(a,b)$ for the population mean:

\n

$a=\\;${p}[[1]] {units}          $b=\\;${p}[[2]] {units}

\n

Enter both to 2 decimal places.

", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Known", "Unknown"], "matrix": [0, 1], "distractors": ["", ""]}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lci-0.01", "maxValue": "lci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "uci-0.01", "maxValue": "uci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Find a confidence interval given the mean of a sample, , ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "tags": ["checked2015"], "metadata": {"description": "

Finding the confidence interval at either 90%, 95% or 99% for the mean given the mean of a sample. The population variance is given and so the z values are used. Various scenarios are included.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "\n

A company {sc[s]} {dothis[s]} $\\var{sd[s]}$ {units}.

\n

A random sample of $\\var{n}$ {t[s]} gives a mean  of $\\var{m[s]}$ {units}. 

\n

 

\n ", "advice": "

a)

\n

We use the z tables to find the confidence interval as we know the population variance.

\n

We now calculate the $\\var{confl}$% confidence interval.

\n

Note that $z_{\\var{confl/100}}=\\var{zval}$ and the confidence interval is given by:

\n

\\[ \\var{m[s]} \\pm z_{\\var{confl/100}}\\sqrt{\\frac{\\var{sd2}}{\\var{n}}}\\]

\n

Hence:

\n

Lower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{lci}${units} to 2 decimal places.

\n

Upper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{uci}${units} to 2 decimal places.

\n

b)

\n

Since $\\var{aim}$ {doornot} {lies} in the confidence interval the answer is {Correct}.

\n

 

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"aim": {"name": "aim", "group": "Ungrouped variables", "definition": "if(s=0,750,if(s=1,100,if(s=2,100,1500)))", "description": "", "templateType": "anything", "can_override": false}, "confl": {"name": "confl", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "", "templateType": "anything", "can_override": false}, "sd": {"name": "sd", "group": "Ungrouped variables", "definition": "\n [random(800..1400#20),\n random(1200..1800#20),\n random(300..600#20),\n random(100..200#0.1)]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "sd1": {"name": "sd1", "group": "Ungrouped variables", "definition": "if(s=3,sd[s],sqrt(sd[s]))", "description": "", "templateType": "anything", "can_override": false}, "sc4ch": {"name": "sc4ch", "group": "Ungrouped variables", "definition": "random(\"supermarkets\",\"clothing retailers\",\"department stores\",\"fast food outlets\")", "description": "", "templateType": "anything", "can_override": false}, "lies": {"name": "lies", "group": "Ungrouped variables", "definition": "if(test=0,\"lies\",\"lie\")", "description": "", "templateType": "anything", "can_override": false}, "howwell": {"name": "howwell", "group": "Ungrouped variables", "definition": "\n [\"On average, is the company reaching its target of 750g per bag?\",\n \"The bolts are designed to be 100mm long. Is the process satisfactory?\",\n \"The vending machines are supposed to fill 100ml cups. Is the machine working satisfactorily?\",\n \"The company aims for an average salary of \u00a31500 per month per worker. Is the aim being met?\"]\n ", "description": "", "templateType": "anything", "can_override": false}, "correct": {"name": "correct", "group": "Ungrouped variables", "definition": "if(test=0, \"yes\", \"no\")", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(20..100)", "description": "", "templateType": "anything", "can_override": false}, "sc2ch": {"name": "sc2ch", "group": "Ungrouped variables", "definition": "random(\"bolts\",\"screws\")", "description": "", "templateType": "anything", "can_override": false}, "dothis": {"name": "dothis", "group": "Ungrouped variables", "definition": "\n [var1 + \" is\",\n \"with a \"+var2+\" of\",\n var3+ \" is\",\n \"knows that the population standard deviation for the wages of employees is\"]\n \n \n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "var3": {"name": "var3", "group": "Ungrouped variables", "definition": "random(\"The variance of the filling process \",\"The process variance \")", "description": "", "templateType": "anything", "can_override": false}, "sc3ch": {"name": "sc3ch", "group": "Ungrouped variables", "definition": "random(\"hot water.\",\"tea.\",\"coffee.\",\"hot chocolate.\",\"cappuccino.\")", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "\n [random(700..745),\n random(95..98),\n random(90..99),\n random(1000..2500#50)]\n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "mm": {"name": "mm", "group": "Ungrouped variables", "definition": "[1-test,test]", "description": "", "templateType": "anything", "can_override": false}, "sc1ch": {"name": "sc1ch", "group": "Ungrouped variables", "definition": "random(\"flour.\",\"sugar.\",\"dried milk.\",\"instant coffee.\")", "description": "", "templateType": "anything", "can_override": false}, "var2": {"name": "var2", "group": "Ungrouped variables", "definition": "random(\"process variance \",\"population variance \")", "description": "", "templateType": "anything", "can_override": false}, "lci": {"name": "lci", "group": "Ungrouped variables", "definition": "precround(tlci,2)", "description": "", "templateType": "anything", "can_override": false}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "\n [\"packs sacks of \"+sc1ch,\n \"manufactures \"+sc2ch,\n \"produces vending machines which fill cups with \"+sc3ch,\n \"in charge of the accounts of a large chain of \"+sc4ch\n ]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "uci": {"name": "uci", "group": "Ungrouped variables", "definition": "precround(tuci,2)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "description": "", "templateType": "anything", "can_override": false}, "tuci": {"name": "tuci", "group": "Ungrouped variables", "definition": "m[s]+zval*sqrt(sd1^2/n)", "description": "", "templateType": "anything", "can_override": false}, "zval": {"name": "zval", "group": "Ungrouped variables", "definition": "if(confl=90,1.645,if(confl=95,1.96,2.576))", "description": "", "templateType": "anything", "can_override": false}, "tlci": {"name": "tlci", "group": "Ungrouped variables", "definition": "m[s]-zval*sqrt(sd1^2/n)", "description": "", "templateType": "anything", "can_override": false}, "spec": {"name": "spec", "group": "Ungrouped variables", "definition": "if(s=2,\"the timecards of \", \" \")", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(0..abs(sc)-1)", "description": "", "templateType": "anything", "can_override": false}, "test": {"name": "test", "group": "Ungrouped variables", "definition": "if(aim lci,0,1)", "description": "", "templateType": "anything", "can_override": false}, "doornot": {"name": "doornot", "group": "Ungrouped variables", "definition": "if(test=0, \" \",\"does not\")", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "\n [\"bags \",\n sc2ch,\n \"filled cups \",\n \"monthly wage slips \"]\n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "var1": {"name": "var1", "group": "Ungrouped variables", "definition": "random(\"The variance of the filling process \",\"The process variance \")", "description": "", "templateType": "anything", "can_override": false}, "sd2": {"name": "sd2", "group": "Ungrouped variables", "definition": "if(s=3,sd[s]^2,sd[s])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sd1", "sd2", "howwell", "n", "doornot", "uci", "test", "confl", "spec", "var1", "var3", "var2", "sc2ch", "units", "zval", "sc1ch", "lci", "tuci", "lies", "mm", "dothis", "sc4ch", "m", "correct", "aim", "sc3ch", "s", "tlci", "t", "sc", "sd"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n

Calculate a  $\\var{confl}$% confidence interval $(a,b)$ for the population mean:

\n

$a=\\;$[[0]]{units}          $b=\\;$[[1]]{units}

\n

Enter both to 2 decimal places.

\n

 

\n ", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lci-0.01", "maxValue": "lci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "uci-0.01", "maxValue": "uci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n

{howwell[s]}

\n

[[0]]

\n ", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Yes", "No"], "matrix": "mm"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Perform a one-way ANOVA", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"btss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stovern-G^2/N,2)", "description": "", "name": "btss"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu1,sig1)),6)", "description": "", "name": "r1"}, "dfbt": {"templateType": "anything", "group": "Ungrouped variables", "definition": "k-1", "description": "", "name": "dfbt"}, "pmsg": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[' is less than $0.001$',' lies between $0.001$ and $0.01$',' lies between $0.01$ and $0.05$',' lies between $0.05$ and $0.10$',' is greater than $0.10$']", "description": "", "name": "pmsg"}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..5#0.2)", "description": "", "name": "sig1"}, "ssq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2)),sum(map(x^2,x,r3))]", "description": "", "name": "ssq"}, "pvalue": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ftest(VR,2,15),3)", "description": "", "name": "pvalue"}, "mrs": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(RSS/dfrs,2)", "description": "", "name": "mrs"}, "sd1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pstdev(r1),2)", "description": "", "name": "sd1"}, "tss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ss-G^2/N,2)", "description": "", "name": "tss"}, "m3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r3),2)", "description": "", "name": "m3"}, "k": {"templateType": "anything", "group": "Ungrouped variables", "definition": "3", "description": "", "name": "k"}, "cmsg": {"templateType": "anything", "group": "Ungrouped variables", "definition": "['do reject','do reject','do not reject','do not reject','do not reject']", "description": "", "name": "cmsg"}, "mu1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(20..25#0.5)", "description": "", "name": "mu1"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "n1+n2+n3", "description": "", "name": "n"}, "stovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(tsqovern)", "description": "", "name": "stovern"}, "sig2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sig1", "description": "", "name": "sig2"}, "v1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pvalue<=0.001,[1,0,0,0,0],pvalue<=0.01,[0,1,0,0,0],pvalue<=0.05,[0,0,1,0,0],pvalue<=0.1,[0,0,0,1,0],[0,0,0,0,1])", "description": "", "name": "v1"}, "mu2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(22..28#0.5)", "description": "", "name": "mu2"}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "6", "description": "", "name": "n3"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "6", "description": "", "name": "n2"}, "vr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(MBT/MRS,2)", "description": "", "name": "vr"}, "dfrs": {"templateType": "anything", "group": "Ungrouped variables", "definition": "N-k", "description": "", "name": "dfrs"}, "rss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ss-stovern,2)", "description": "", "name": "rss"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(r1),sum(r2),sum(r3)]", "description": "", "name": "t"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "6", "description": "", "name": "n1"}, "sd3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pstdev(r3),2)", "description": "", "name": "sd3"}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r1),2)", "description": "", "name": "m1"}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(ssq)", "description": "", "name": "ss"}, "r3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu3,sig3)),6)", "description": "", "name": "r3"}, "sig3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sig1", "description": "", "name": "sig3"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(vr>=11.34,[1,0,0,0,0],vr>=6.36,[0,1,0,0,0],vr>=3.68,[0,0,1,0,0],vr>=2.7,[0,0,0,1,0],[0,0,0,0,1])", "description": "", "name": "v"}, "m2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r2),2)", "description": "", "name": "m2"}, "stderror": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sqrt(mrs)/sqrt(n1),2)", "description": "", "name": "stderror"}, "mbt": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(BTSS/dfbt,2)", "description": "", "name": "mbt"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu2,sig2)),6)", "description": "", "name": "r2"}, "mu3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(24..32#0.5)", "description": "", "name": "mu3"}, "g": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(t)", "description": "", "name": "g"}, "tsqovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[t[0]^2/n1,t[1]^2/n2,t[2]^2/n3]", "description": "", "name": "tsqovern"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(v[0]=1,0,v[1]=1,1,v[2]=1,2,v[3]=1,3,4)", "description": "", "name": "u"}, "sd2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pstdev(r2),2)", "description": "", "name": "sd2"}}, "ungrouped_variables": ["sd1", "sd2", "sd3", "vr", "mbt", "pmsg", "mu3", "stderror", "n", "m1", "tol", "m2", "btss", "stovern", "tss", "dfbt", "m3", "ssq", "sig1", "v1", "sig3", "sig2", "dfrs", "cmsg", "rss", "tsqovern", "mu1", "g", "r2", "mu2", "ss", "k", "r3", "mrs", "r1", "u", "t", "v", "n1", "n2", "n3", "pvalue"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"pstdev": {"type": "number", "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "parameters": [["l", "list"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "m1", "minValue": "m1", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sd1", "minValue": "sd1", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "t[0]", "minValue": "t[0]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ssq[0]", "minValue": "ssq[0]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "m2", "minValue": "m2", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sd2", "minValue": "sd2", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "t[1]", "minValue": "t[1]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ssq[1]", "minValue": "ssq[1]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "m3", "minValue": "m3", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sd3", "minValue": "sd3", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "t[2]", "minValue": "t[2]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ssq[2]", "minValue": "ssq[2]", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "g", "minValue": "g", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ss", "minValue": "ss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n

First fill in this table with the appropriate values, all decimals to 2 decimal places:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 $\\overline{x}_i$$s_i$$T_i$$\\sum x^2$$n_i$
Group A[[0]][[1]][[2]][[3]]6
Group B[[4]][[5]][[6]][[7]]6
Group C[[8]][[9]][[10]][[11]]6
   $G=\\;$[[12]]Sum of Squares=[[13]]$N=18$
\n

Note that in doing this you will have supplied the sample means and sample standard deviations for the three groups.

\n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "tss", "minValue": "tss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "btss", "minValue": "btss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "rss", "minValue": "rss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Now find the following, all to 2 decimal places:

\n

$\\displaystyle SST\\;=\\;$[[0]], $\\displaystyle SSG\\;=\\;$[[1]], $\\displaystyle SSW\\;=\\;$[[2]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "dfbt", "minValue": "dfbt", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "btss", "minValue": "btss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mbt", "minValue": "mbt", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "vr", "minValue": "vr", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "dfrs", "minValue": "dfrs", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "rss", "minValue": "rss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mrs", "minValue": "mrs", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "n-1", "minValue": "n-1", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "tss", "minValue": "tss", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Now complete the ANOVA table using the values to 2 decimal places obtained above:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
SourcedfSSMSF
Between groups[[0]][[1]][[2]][[3]]
Within groups[[4]][[5]][[6]]-
Total[[7]][[8]]--
\n

Note that is found by taking the ratio of two of the values in this table.

\n

Input all numbers to 2 decimal places.

", "showCorrectAnswer": true, "marks": 0}, {"displayType": "radiogroup", "choices": ["

$p$ less than $0.1\\%$

", "

$p$ lies between $0.1\\%$ and $1\\%$

", "

$p$ lies between $1 \\%$ and $5\\%$

", "

$p$ lies between $5 \\%$ and $10\\%$

", "

$p$ is greater than $10\\%$

"], "displayColumns": 1, "prompt": "

Give the value of $F$ you have found, choose the range for the $p$ value by looking up the critical values of $F_{2,15}$ (one-sided).

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$10\\%$$5\\%$$1\\%$$0.1\\%$
$2.70$$3.68$$6.36$$11.34$
", "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "v", "marks": 0}, {"displayType": "radiogroup", "choices": ["Very strong", "Strong", "Moderate", "Weak", "None"], "displayColumns": 0, "prompt": "

Given the $p$-value and the range you have found, what is the strength of evidence against the null hypothesis that the mean times taken are the same for the three groups?

", "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "v", "marks": 0}, {"displayType": "radiogroup", "choices": ["We reject the null hypothesis at the $0.1\\%$ level", "We reject the null hypothesis at the $1\\%$ level.", "We reject the null hypothesis at the $5\\%$ level.", "We do not reject the null hypothesis but consider further investigation.", "We do not reject the null hypothesis."], "displayColumns": 1, "prompt": "

Hence what is your decision based on the above ANOVA analysis?

", "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "v", "marks": 0}], "statement": "

The following data arose in a comparison of the effects of alcohol on the time taken to complete a task. There were three groups of subjects; Group A had no alcohol, Group B had two units over 1 hour and Group C had 4 units over 1 hour. The responses are the times (in seconds) taken to complete a word-matching task.

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Group A (0 units)$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$
Group B (2 units)$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$
Group C (4 units)$\\var{r3[0]}$$\\var{r3[1]}$$\\var{r3[2]}$$\\var{r3[3]}$$\\var{r3[4]}$$\\var{r3[5]}$
\n \n

 

", "tags": ["ACE2013", "ANOVA", "average", "checked2015", "data analysis", "degrees of freedom", "F-test", "hypothesis testing", "mean", "mean ", "one-way ANOVA", "one-way Anova", "standard deviation", "statistics", "stats", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t \t\t

11/07/2012:

\n \t\t \t\t


Added tags.

\n \t\t \t\t

Calculation not yet tested.

\n \t\t \t\t

23/07/2012:

\n \t\t \t\t

Added description.

\n \t\t \t\t

Checked calculation.

\n \t\t \t\t

3/08/2012:

\n \t\t \t\t

Added tags.

\n \t\t \t\t

Question appears to be working correctly.

\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

One-way ANOVA example

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": ""}, {"name": "Perform a paired sample t-test, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"pvalue": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ttest(0,d,2),3)", "name": "pvalue", "description": ""}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu1,sig1)),12)", "name": "r1", "description": ""}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(tvalue>=t999,[1,0,0,0,0],if(tvalue>=t99,[0,1,0,0,0],if(tvalue>=t95,[0,0,1,0,0],if(tvalue>=t90,[0,0,0,1,0],[0,0,0,0,1]))))", "name": "v", "description": ""}, "pmsg": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[' is less than $0.001$',' lies between $0.001$ and $0.01$',' lies between $0.01$ and $0.05$',' lies between $0.05$ and $0.10$',' is greater than $0.10$']", "name": "pmsg", "description": ""}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..3#0.2)", "name": "sig1", "description": ""}, "t90": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1.796", "name": "t90", "description": ""}, "tvalue": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(meandiff*sqrt(n)/stdiff),3)", "name": "tvalue", "description": ""}, "cmsg": {"templateType": "anything", "group": "Ungrouped variables", "definition": "['do reject','do reject','do not reject','do not reject','do not reject']", "name": "cmsg", "description": ""}, "t99": {"templateType": "anything", "group": "Ungrouped variables", "definition": "3.106", "name": "t99", "description": ""}, "mu1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(18..25#0.5)", "name": "mu1", "description": ""}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(v[0]=1,0,v[1]=1,1,v[2]=1,2,v[3]=1,3,4)", "name": "t", "description": ""}, "sig2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4#0.2)", "name": "sig2", "description": ""}, "meandiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(d),3)", "name": "meandiff", "description": ""}, "t999": {"templateType": "anything", "group": "Ungrouped variables", "definition": "4.437", "name": "t999", "description": ""}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "list(vector(r2)-vector(r1))", "name": "d", "description": ""}, "object": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Individual'", "name": "object", "description": ""}, "stdiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pstdev(d),3)", "name": "stdiff", "description": ""}, "t95": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2.201", "name": "t95", "description": ""}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "12", "name": "n", "description": ""}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu2,sig2)),12)", "name": "r2", "description": ""}, "mu2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mu1+random(2..4#0.1)", "name": "mu2", "description": ""}, "cmsg1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "['very strong','strong','slight','no','no']", "name": "cmsg1", "description": ""}, "msg": {"templateType": "anything", "group": "Ungrouped variables", "definition": "['is greater than $\\\\var{t999}$','lies between $\\\\var{t99}$ and $\\\\var{t999}$','lies between $\\\\var{t95}$ and $\\\\var{t99}$','lies between $\\\\var{t90}$ and $\\\\var{t95}$','is less than $\\\\var{t90}$']", "name": "msg", "description": ""}}, "ungrouped_variables": ["pmsg", "msg", "cmsg1", "t999", "meandiff", "object", "sig1", "tvalue", "stdiff", "sig2", "t99", "t95", "t90", "cmsg", "d", "mu1", "r1", "r2", "mu2", "n", "t", "v", "pvalue"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"pstdev": {"type": "number", "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "parameters": [["l", "list"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{meandiff}", "maxValue": "{meandiff}", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{stdiff}", "maxValue": "{stdiff}", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{tvalue}", "maxValue": "{tvalue}", "marks": 1}], "type": "gapfill", "prompt": "

Find the mean and standard deviations of the difference between left and right {attempt}s.

\n

Calculate differences for left {attempt} times – right {attempt} times. Make sure you take the differences this way round.

\n

Mean of difference = [[0]] (input  to 3 decimal places )

\n

Standard deviation of difference = [[1]] (input to 3 decimal places)

\n

Now find the t-test statistic $T$ using the values you have just calculated and  input the absolute value $|T|$ here: [[2]] (3 decimal places). 

\n

 

", "showCorrectAnswer": true, "marks": 0}, {"displayType": "radiogroup", "choices": ["

$p$ less than $0.1 \\%$

", "

$p$ lies between $0.1\\%$ and $1 \\%$

", "

$p$ lies between $1 \\%$ and $5\\%$

", "

$p$ lies between $5 \\%$ and $10\\%$

", "

$p$ is greater than $10\\%$

"], "displayColumns": 0, "prompt": "

Give the value of the t-statistic you have found, choose the range for the $p$ value by looking up the t-statistic tables:

", "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "v", "marks": 0}, {"displayType": "radiogroup", "choices": ["

Very Strong Evidence

", "

Strong Evidence

", "

Evidence

", "

Weak Evidence

", "

No Evidence

"], "displayColumns": 0, "prompt": "

Given the $p$-value and the range you have found, what is the strength of evidence against the null hypothesis that there is no difference in the average times for the left and right hands?

", "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "v", "marks": 0}], "statement": "

The following data was obtained from $12$ individuals. The observations consist of the time taken to complete a dexterity task using their left and right hands.

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{object}ABCDEFGHIJKL
Right$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r1[10]}$$\\var{r1[11]}$
Left$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$$\\var{r2[10]}$$\\var{r2[11]}$
\n

Carry out by hand a paired t-test to test whether there is evidence of a difference in the average times for the left and right hands.

", "tags": ["ACE2013", "average", "checked2015", "data analysis", "differences", "elementary statistics", "hypothesis testing", "mean", "mean ", "mean of differences", "paired t-test", "PSY2010", "standard deviation", "standard deviation of differences", "statistics", "stats", "t-test", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t \t\t

11/07/2012:

\n \t\t \t\t


Added tags.

\n \t\t \t\t

Calculation not yet tested.

\n \t\t \t\t

23/07/2012:

\n \t\t \t\t

Added description.

\n \t\t \t\t

Checked calculation.

\n \t\t \t\t

Changed display slightly in Advice.

\n \t\t \t\t

3/08/2012:

\n \t\t \t\t

Added tags.

\n \t\t \t\t

Question appears to be working correctly.

\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Paired t-test to see if there is a difference between times take in a task.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

The table of differences is given by:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{object}ABCDEFGHIJKL
Right$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r1[10]}$$\\var{r1[11]}$
Left$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$$\\var{r2[10]}$$\\var{r2[11]}$
Differences$\\var{d[0]}$$\\var{d[1]}$$\\var{d[2]}$$\\var{d[3]}$$\\var{d[4]}$$\\var{d[5]}$$\\var{d[6]}$$\\var{d[7]}$$\\var{d[8]}$$\\var{d[9]}$$\\var{d[10]}$$\\var{d[11]}$
\n

We test the following hypothesis:

\n

$H_0:\\;\\mu_d=0$ versus $H_1:\\;\\mu_d\\neq 0$

\n

$n=\\var{n}$ and the mean of the differences is $\\overline{d}=\\var{meandiff}$.

\n

The variance $V$ of the differences is calculated to be $\\var{pstdev(d)^2}$

Hence we have the standard deviation $s_d= \\sqrt{V}=\\var{stdiff}$ to 3 decimal places.

\n

The paired t-statistic is given by:

\n

\\[\\begin{eqnarray*} T&=&\\frac{\\overline{d}-\\mu_d}{\\frac{s_d}{\\sqrt{n}}}\\\\&=&\\frac{\\var{meandiff}-0}{\\frac{\\var{stdiff}}{\\sqrt{\\var{n}}}}\\\\&=&\\var{tvalue}\\end{eqnarray*}\\]

\n

(Using the null hypothesis that the means are the same i.e. $\\mu_d=0$.)

\n

Hence our test statistic  $|T|=\\var{tvalue}$.

\n

Looking up this value on the T-distribution table for $t_{11}$

\n

\\[\\begin{array}{r|rrrrr}&0.20&0.10&0.05&0.01&0.001\\\\\\hline11&1.363&1.796&2.201&3.106&4.437\\end{array}\\]

\n

We see that the t-statistic {msg[t]} and the table tells us that the $p$ value {pmsg[t]}.

\n

Hence we conclude that we {cmsg[t]} the null hypothesis. There is {cmsg1[t]} evidence of a difference between the average scores of the two groups.

\n

 

"}, {"name": "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}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "evi": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "description": "", "name": "evi"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..15)", "description": "", "name": "n1"}, "confl": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[90,95,99]", "description": "", "name": "confl"}, "sd1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(65..90)", "description": "", "name": "sd1"}, "correctc": {"templateType": "anything", "group": "Ungrouped variables", "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\")", "description": "", "name": "correctc"}, "tval1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "abs(m-m1)*sqrt(n1*n2)/(tpsd*sqrt(n1+n2))", "description": "", "name": "tval1"}, "crit": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "description": "", "name": "crit"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "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.\"", "description": "", "name": "this"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "n1+n2-1", "description": "", "name": "n"}, "tval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tval1,3)", "description": "", "name": "tval"}, "dothis": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval <2, 'retain','reject')", "description": "", "name": "dothis"}, "pm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "description": "", "name": "pm"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(20..30)-n1", "description": "", "name": "n2"}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "description": "", "name": "mm"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"male employees\"", "description": "", "name": "things"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(220..380#10)", "description": "", "name": "m"}, "evi1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "description": "", "name": "evi1"}, "units": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"seconds\"", "description": "", "name": "units"}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(55..85)", "description": "", "name": "sd"}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(280..400#10)", "description": "", "name": "m1"}, "fac": {"templateType": "anything", "group": "Ungrouped variables", "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\")", "description": "", "name": "fac"}, "tpsd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqrt(((n1-1)*sd^2+(n2-1)*sd1^2)/(n-1))", "description": "", "name": "tpsd"}, "dmm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,[1,0],[0,1])", "description": "", "name": "dmm"}, "that": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"the average time spent on the telephone \"", "description": "", "name": "that"}, "pval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(tvalStep 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 ", "showCorrectAnswer": true, "scripts": {}, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "t", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "psd+tol", "minValue": "psd-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "tval+tol", "minValue": "tval-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "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]] (to 3 decimal places)

\n

 

\n

Now calculate the test statistic = ? [[2]]  (to 3 decimal places)

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

", "showCorrectAnswer": true, "marks": 0}, {"stepsPenalty": 0, "scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}], "type": "gapfill", "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

Click on Show steps below to get more information on using the t tables to find the p-value range. You will not lose any marks.

\n

 

", "steps": [{"type": "information", "prompt": "

Click here to get more information about using t tables.

\n

You will also find the critical values of the t tables in this link.

", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}, {"displayType": "radiogroup", "choices": ["Retain", "Reject"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "dmm", "marks": 0}, {"displayType": "radiogroup", "choices": ["{Correctc}", "{Fac}"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0], "marks": 0}], "type": "gapfill", "prompt": "\n

 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:

\n

[[1]]

\n

 

\n

Conclusion:

\n

[[2]]

\n ", "showCorrectAnswer": true, "marks": 0}], "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": ["ACC1012", "accept null hypothesis", "ACE2013", "alternative hypothesis", "checked2015", "comparing means", "degree of freedom", "diagram", "hypothesis testing", "link", "MAS1403", "null hypothesis", "p values", "pooled standard deviation", "population variance", "random sample", "reject null hypothesis", "sample mean", "sampling", "sc", "statistics", "Steps", "steps", "t tables", "t test", "test statistic", "two-tailed test"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t

3/01/2012:

\n \t\t

Added tag sc as can be changed to other applications. Perhaps the tables used should be improved.

\n \t\t

Missing a diagram from the original iassess question, hence tag diagram added.

\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "


b)

\n

Step 3 : Test statistic

\n

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

\n

The pooled standard deviation  is 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

c)

\n

Step 4: 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

d)

\n

Step 5: Conclusion

\n

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

\n

{Correctc}.

"}, {"name": "Perform t-test for hypothesis given sample mean and standard deviation", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "dmm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,[1,0],[0,1])", "description": "", "name": "dmm"}, "thisamount": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(70..90)", "description": "", "name": "thisamount"}, "confl": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "", "name": "confl"}, "pval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(tval1,\"There is sufficient evidence against the claim of the flight company.\",\"There is insufficient evidence against the claim of the flight company.\")", "description": "", "name": "correctc"}, "test": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"A rival flight company decides to test their claim.\"", "description": "", "name": "test"}, "crit": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "description": "", "name": "crit"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"An online flight company makes the following claim:\"", "description": "", "name": "this"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..30)", "description": "", "name": "n"}, "tval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tval1,3)", "description": "", "name": "tval"}, "dothis": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval <2, 'retain','reject')", "description": "", "name": "dothis"}, "pm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "description": "", "name": "pm"}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "description": "", "name": "mm"}, "here": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"Barcelona\",\"Madrid\",\"Athens\",\"Berlin\",\"Palma\",\"Rome\",\"Paris\",\"Lisbon\")", "description": "", "name": "here"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"customers is taken.\"", "description": "", "name": "things"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "thisamount+random(1..15)", "description": "", "name": "m"}, "claim": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"The average cost of a flight with us to \"+ here + \" is just \u00a3\" + {thisamount} + \" (including all taxes and charges!)\"", "description": "", "name": "claim"}, "evi1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "description": "", "name": "evi1"}, "tval1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "abs(m-thisamount)*sqrt(n)/stand", "description": "", "name": "tval1"}, "fac": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,\"There is sufficient evidence against the claim of the flight company\",\"There is insufficient evidence against the claim of the flight company.\")", "description": "", "name": "fac"}, "evi": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "description": "", "name": "evi"}, "stand": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15..25)", "description": "", "name": "stand"}, "resultis": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \"", "description": "", "name": "resultis"}}, "ungrouped_variables": ["claim", "pval", "evi1", "crit", "tval1", "things", "stand", "tol", "test", "pm", "correctc", "resultis", "here", "fac", "confl", "evi", "this", "dothis", "m", "dmm", "n", "mm", "thisamount", "tval"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "thisamount", "minValue": "thisamount", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "thisamount", "minValue": "thisamount", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;$[[1]]

\n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "t", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "tval+tol", "minValue": "tval-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Step 3: Test statistic

\n

Should we use the z or t test statistic? [[0]] (enter z or t).

\n

Now calculate the test statistic = ? [[1]] (to 3 decimal places)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}], "type": "gapfill", "prompt": "\n

Step 4: p-value

\n

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

\n

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

\n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}, {"displayType": "radiogroup", "choices": ["Retain", "Reject"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "dmm", "marks": 0}, {"displayType": "radiogroup", "choices": ["{Correctc}", "{Fac}"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0], "marks": 0}], "type": "gapfill", "prompt": "\n

Step 5: Conclusion

\n

 

\n

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:

\n

[[1]]

\n

 

\n

Conclusion:

\n

[[2]]

\n ", "showCorrectAnswer": true, "marks": 0}], "statement": "\n

{this} 

\n

{claim}

\n

{test}

\n

A sample of {n} {things}

\n

{resultis} £{m} with a standard  deviation of £{stand}.

\n

Perform an appropriate hypothesis test to see if the claim made by the online flight company is substantiated (use a two-tailed test).

\n ", "tags": ["checked2015", "MAS1403"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t

2/01/2012:

\n \t\t

Added tag sc as has string variables in order to generate other scenarios.

\n \t\t

The jstat function studenttinv(critvalue,n-1) gives the critical p values correctly.

\n \t\t

Added tag diagram as the i-assess question advice has a nice graphic of the p-value and the appropriate decision.

\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Provided with information on a sample with sample mean and standard deviation, but no information on the population variance, use the t test to either accept or reject a given null hypothesis.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n

a)

\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thisamount}$

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$

\n

b)

\n

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

\n

The test statistic:

\n

\\[t =\\frac{ |\\var{m} -\\var{thisamount}|} {\\sqrt{\\frac{\\var{stand} ^ 2 }{\\var{n}}}} = \\var{tval}\\]

\n

to 3 decimal places.

\n

c)

\n

As  $n=\\var{n}$ 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


d)

\n

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

\n

{Correctc}

\n "}, {"name": "Find regression equation and correlation coefficient", "extensions": ["stats", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[random(0..6),random(1..7),random(4..10),random(7..13),random(12..18),random(4..20),random(16..22),random(19..25),random(17..23),random(13..19),random(8..14),random(3..9)]", "description": "", "name": "r1"}, "spxy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sxy-t[0]*t[1]/n", "description": "", "name": "spxy"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "description": "", "name": "a"}, "tcorr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "spxy/sqrt(ss[0]*ss[1])", "description": "", "name": "tcorr"}, "ssq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "description": "", "name": "ssq"}, "prediction": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(a+b*thisval)", "description": "", "name": "prediction"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(r1),sum(r2)]", "description": "", "name": "t"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..20)", "description": "", "name": "a1"}, "sumr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sum(map(res[x]^2,x,0..n-1)),3)", "description": "", "name": "sumr"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol1"}, "beverage": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"home-brewed beer\",\"home-brewed lager\",\"specially-brewed beer\",\"super-strength lager\",\"cold-filtered lager\",\"ice-filtered cider\",\"cherry cider\")", "description": "", "name": "beverage"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "12", "description": "", "name": "n"}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "description": "", "name": "ss"}, "corr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tcorr,2)", "description": "", "name": "corr"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(spxy/ss[0],3)", "description": "", "name": "b"}, "pub": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"Black Bull Inn\",\"County Inn\",\"Dog and Duck Pub\",\"Slug and Lettuce Pub\", \"Cross Keys Pub\",\"Newcastle Arms Pub\",\"Red Lion Pub\")", "description": "", "name": "pub"}, "res": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(precround(r2[x]-(a+b*r1[x]),2),x,0..n-1)", "description": "", "name": "res"}, "ch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..11)", "description": "", "name": "ch"}, "sc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r1[ch]", "description": "", "name": "sc"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.25..0.45#0.05)", "description": "", "name": "b1"}, "sxy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "description": "", "name": "sxy"}, "thisval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15..22)", "description": "", "name": "thisval"}, "obj": {"templateType": "anything", "group": "Ungrouped variables", "definition": "['Jan','Feb','March','April','May','June','July','August','Sept','Oct','Nov','Dec']", "description": "", "name": "obj"}, "owner": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"Kevin\",\"Mary\",\"Bill\",\"Doreen\",\"Peter\",\"Helen\",\"Michael\",\"Samantha\")", "description": "", "name": "owner"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(round(a1+b1*x+random(-9..9)),x,r1)", "description": "", "name": "r2"}, "ls": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(a+b*sc,2)", "description": "", "name": "ls"}, "tsqovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[t[0]^2/n,t[1]^2/n]", "description": "", "name": "tsqovern"}, "rsquared": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(spxy^2/(ss[0]*ss[1]),3)", "description": "", "name": "rsquared"}}, "ungrouped_variables": ["ch", "prediction", "b1", "owner", "sxy", "res", "spxy", "ls", "tol", "tcorr", "tsqovern", "ssq", "sumr", "thisval", "a1", "pub", "corr", "a", "b", "obj", "r1", "r2", "ss", "tol1", "n", "beverage", "t", "sc", "rsquared"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"regressline": {"type": "html", "language": "javascript", "definition": "\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[-5,maxy,maxx,-5],\n axis:true,\n showNavigation:false,\n grid:false});\n var board = div.board; \nvar l1=board.create('text',[maxx/2,-2,'Temperature']);\nvar l2=board.create('text',[-2,maxy/2,'Sales']);\nvar names = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\nfor (j=0;j<12;j++){ board.create('point',[r1[j],r2[j]],{fixed:true, style:3,name:'\\\\\\\\['+names[j]+'\\\\\\\\]'})};\nvar a1 = board.create('point',[minx+5,miny+5],{color:'blue'});\nvar b1 = board.create('point',[minx+7,miny+5],{color:'blue'});\nfunction updr(a,b){\n var s=0;\n for(var i=0;i<12;i++){\ns=s+Math.pow(r2[i]-a*r1[i]-b,2);}\ns=Numbas.math.niceNumber(Numbas.math.precround(s,2));\n$('#rsquared').text(s);}\n var li=board.create('line',[a1,b1], {straightFirst:false, straightLast:false});\n var a=0;\n var b=0;\n function dr(p){\n p.on('drag',function(){\n a = Numbas.math.niceNumber((b1.Y()-a1.Y())/(b1.X()-a1.X()));\n b = Numbas.math.niceNumber((a1.Y()*b1.X()-a1.X()*b1.Y())/(b1.X()-a1.X()));\n Numbas.exam.currentQuestion.parts[1].gaps[0].display.studentAnswer(a);\n Numbas.exam.currentQuestion.parts[1].gaps[1].display.studentAnswer(b);\n updr(a,b);\n })};\n dr(a1);\n dr(b1);\n \nreturn div;\n\n \n", "parameters": [["r1", "list"], ["r2", "list"], ["minx", "number"], ["maxx", "number"], ["miny", "number"], ["maxy", "number"]]}, "regfun": {"type": "html", "language": "javascript", "definition": "\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[-5,maxy,maxx,-5],\n axis:true,\n showNavigation:false,\n grid:true});\n var board = div.board; \nvar l1=board.create('text',[maxx/2,-2,'Temperature']);\nvar l2=board.create('text',[-2,maxy/2,'Sales']);\n var names = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n for (j=0;j<12;j++){ board.create('point',[r1[j],r2[j]],{fixed:true, style:3, strokecolor:\"#0000a0\", name:'\\\\\\\\['+names[j]+'\\\\\\\\]'})};\nvar regressionPolynomial = JXG.Math.Numerics.regressionPolynomial(1, r1, r2);\nvar reg = board.create('functiongraph',[regressionPolynomial],{strokeColor:'blue',name:'Regression Line.',withLabel:true}); \n //for(var i=0;i<12;i++){board.create(\"segment\",[[r1[i],r2[i]],[r1[i],regressionPolynomial(r1[i])]])};\nvar regExpression = regressionPolynomial.getTerm();\nvar regTeX = Numbas.jme.display.exprToLaTeX(regExpression,[],scope);\n\nvar t = board.create('text',[1,5,\nfunction(){ return \"\\\\[r(Y) = \" + regExpression +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nvar t1 = board.create('text',[5,maxy,\nfunction(){ return \"\\\\[SSE = \" + sumr +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nvar t2 = board.create('text',[20,maxy,\nfunction(){ return \"\\\\[R^2 = \" + rsquared +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nreturn div;\n \n", "parameters": [["r1", "list"], ["r2", "list"], ["maxx", "number"], ["maxy", "number"], ["rsquared", "number"], ["sumr", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "corr+tol1", "minValue": "corr-tol1", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Calculate the sample correlation coefficient $r$ for these data:

\n

$r=\\;$[[0]] (enter to 2 decimal places).

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

Calculate the equation of the best fitting regression line.

\n

\\[Y = \\beta_0 + \\beta_1X.\\] Find $\\beta_0$ and $\\beta_1$ to 5 decimal places, then input them below to 3 decimal places. You will use these approximate values in the rest of the question. 

\n

$\\beta_1=\\;$[[0]],      $\\beta_0=\\;$[[1]] (enter both to 3 decimal places).

\n

You can experiment by dragging the points A and B around to see if you can get close to the regression line. 

\n

{regressline(r1,r2,min(r1)-10,max(r1)+10,min(r2)-10,max(r2)+10)}

\n

\n

Click on Show steps if you want more information on calculating $\\beta_0$ and $\\beta_1$. You will not lose any marks by doing so.

\n

 

", "steps": [{"type": "information", "prompt": "

To find $\\beta_0$ and $\\beta_1$ you first find  $\\displaystyle \\beta_1 = \\frac{SPXY}{SSX}$ where:

\n

$\\displaystyle SPXY=\\sum xy - \\frac{(\\sum x)\\times (\\sum y)}{\\var{n}}$

\n

$\\displaystyle SSX=\\sum x^2 - \\frac{(\\sum x)^2}{\\var{n}}$

\n

Then $\\displaystyle \\beta_0 = \\frac{1}{\\var{n}}\\left[\\sum y-\\beta_1 \\sum x\\right]$

\n

Now go back and fill in the values for $\\beta_0$ and $\\beta_1$.

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

Next month, the average temperature in {owner}'s town is forecast to be  {thisval} Celsius. Use the regression equation in the second part to predict sales of the {beverage} in that month.

\n

What is the predicted value of sales (in hundreds of pounds) ?

\n

Use the values of $\\beta_0$ and $\\beta_1$ you input above to 3 decinal places.

\n

Enter the predicted sales here:  [[0]] (hundreds of pounds to the nearest whole number).

\n

", "showCorrectAnswer": true, "marks": 0}], "statement": "

{owner} owns the {pub}. {owner} believes that sales of {beverage} in the pub are linked to the average monthly temperature, with higher sales being recorded in months with higher temperatures. To investigate, {owner} records the average monthly temperature in the local town over a period of one year ($X$ degrees Celsius), along with total monthly sales of {beverage} ($Y$ hundred pounds). The results are shown 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\n\n\n\n\n\n\n\n\n\n\n
Month$\\var{obj[0]}$$\\var{obj[1]}$$\\var{obj[2]}$$\\var{obj[3]}$$\\var{obj[4]}$$\\var{obj[5]}$$\\var{obj[6]}$$\\var{obj[7]}$$\\var{obj[8]}$$\\var{obj[9]}$$\\var{obj[10]}$$\\var{obj[11]}$
$X$ (temperature)$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r1[10]}$$\\var{r1[11]}$
$Y$ (sales, £100s)$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$$\\var{r2[10]}$$\\var{r2[11]}$
\n

You are given the following information:

\n\n\n\n\n\n\n\n\n\n\n\n
$X$ $\\sum x=\\;\\var{t[0]}$$\\sum x^2=\\;\\var{ssq[0]}$
$Y$$\\sum y=\\;\\var{t[1]}$$\\sum y^2=\\;\\var{ssq[1]}$
\n

Also you are given $\\sum xy = \\var{sxy}$.

", "tags": ["ACE2013", "checked2015", "correlation", "data analysis", "fitted value", "linear regression", "regression", "statistics"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

04/02/2014:

\n

No advice as yet. Adapted from iassess question for ACE.

\n

18/02/2014:

\n

Slight changes in notation from Regression 3. No SSE

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find a regression equation given 12 months data on temperature and sales of a drink. 

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

{regfun(r1,r2,max(r1)+10,max(r2)+10,rsquared,sumr)}

"}, {"name": "Interpret logistic regression output from Minitab", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ansa+ansb*thismuch/1000", "description": "", "name": "r1"}, "seb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.04..1.2#0.000001)", "description": "", "name": "seb"}, "sea": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round((t*v1+(100-t)*v2)+0.000001)/100", "description": "", "name": "sea"}, "ansa": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(-2.24*sea,3)", "description": "", "name": "ansa"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..100)", "description": "", "name": "t"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol1"}, "thismuch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15000..35000#1000)", "description": "", "name": "thismuch"}, "v2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "seb*thismuch/1000+0.9", "description": "", "name": "v2"}, "v1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "seb*thismuch/1000-0.9", "description": "", "name": "v1"}, "prob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(e^(r1)/(1+e^r1),2)", "description": "", "name": "prob1"}, "ansb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(2.25*seb,3)", "description": "", "name": "ansb"}}, "ungrouped_variables": ["seb", "r1", "tol1", "v1", "v2", "t", "tol", "ansa", "ansb", "thismuch", "sea", "prob1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ansa+tol", "minValue": "ansa-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ansb+tol", "minValue": "ansb-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Find $A$ and $B$ each to 3 decimal places:

\n

$A=\\;$[[0]]     $B=\\;$[[1]]

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

Find the probability that an employee with an annual salary of £{thismuch} will be obese.

\n

Enter your answer to two decimal places.

\n

Probability = [[0]]

", "showCorrectAnswer": true, "marks": 0}], "statement": "

It is claimed that there is a relationship between job type and obesity, with employees in more highly-paid, senior roles being more likely to be overweight than those in other roles.

\n

You are an analyst working for a large company and have been given the task to see if this is the case at your workplace. 

\n

You randomly sample 15 employees and record their annual salary ($X$, in thousands of pounds) and whether or not they are obese (have a body mass index of more than 30: $Y=1$  if yes, $Y=0$ if no).

\n

A logistic regression was performed in Minitab, with the following (edited) output shown below:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n
\n

\n
\n

\n
\n

\n
\n

\n
\n

Odds

\n
\n

95% CI

\n
\n

Predictor

\n
\n

Coef

\n
\n

SE Coef

\n
\n

Z

\n
\n

P

\n
\n

Ratio

\n
\n

Lower

\n
\n

Upper

\n

Constant

\n
\n

$A$

\n
\n

{sea}

\n
\n

-2.24

\n
\n

0.025

\n
\n

\n
\n

\n
\n

\n
\n

$x$

\n
\n

$B$

\n
\n

{seb}

\n
\n

2.25

\n
\n

0.025

\n
\n

1.18

\n
\n

1.02

\n
\n

1.37

\n
", "tags": ["ACE2013", "checked2015"], "rulesets": {}, "preamble": {"css": ".minitab {\n font-family: 'Courier', monospace;\n}", "js": ""}, "type": "question", "metadata": {"notes": "

09/02/2014:

\n

Based on an i-assess question. First draft finished.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Interpreting the minitab output from a logistic regression model of salary against obesity as measured by BMI.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

A is given by  A = -2.24 x  SE Coef (A) = -2.24 x {sea} = {ansa} .

\n

B is given by  B =  2.25 x  SE Coef (B) =  2.25 x {seb} = {ansb} .

\n

Both to 3 decimal places.

\n

b)

\n

The probability is given by:

\n

\\[\\begin{align}P(Y=1 | X=\\var{thismuch})&=\\frac{e^{A+B\\times\\var{thismuch/1000}}}{1+e^{A+B\\times\\var{thismuch/1000}}}\\\\&=\\frac{e^{\\var{r1}}}{1+e^{\\var{r1}}}=\\var{prob1}\\end{align}\\]

\n

to 2 decimal places.

\n

"}, {"name": "Interpret Minitab output of multiple regression", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "pred": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ansa +cb*thatmany+ansc*thismany/1000+ansd*q,1)", "description": "", "name": "pred"}, "thismany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5000..12000#1000)", "description": "", "name": "thismany"}, "thatmany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..8)", "description": "", "name": "thatmany"}, "thisrest": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"McDonald's\",\"Pizza Hut\",\"Kentucky Fried Chicken\",\"The Log Fire Pizza Co.\",\"The China Cook\",\"Aneesa's Indian Buffet\",\"Pacino's Italian Restaurant\")", "description": "", "name": "thisrest"}, "sv": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[if(ind=6,\"Rubbish\",\" \"),\"Below Average\",\"Average\",\"Above Average\",\n if(ind=3,\" \",\"Good\"),if(ind>4,\"Fantastic\",\" \")]", "description": "", "name": "sv"}, "hascond": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(q=1,cond,\n p=0,\"has not got a drive-thru window\",\n p=1,\"is not open late (after 11pm)\",\n p=2,\"is not located on a public transport route\",\n \"is not located in a town centre\")", "description": "", "name": "hascond"}, "se": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.03..0.15#0.0001)", "description": "", "name": "se"}, "si": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sval^2,3)", "description": "", "name": "si"}, "place": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"South Shields\", \"North Shields\",\"Newcastle\",\"Sunderland\",\"Alnwick\",\"Durham\",\"Metro Centre\")", "description": "", "name": "place"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1,2,3)", "description": "", "name": "p"}, "ansd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(2.53*sed,3)", "description": "", "name": "ansd"}, "q": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "name": "q"}, "sea": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..5.5#0.001)", "description": "", "name": "sea"}, "ansa": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(3.887*sea,3)", "description": "", "name": "ansa"}, "sed": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..2.20#0.001)", "description": "", "name": "sed"}, "cb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-0.5..-0.1#0.0001)", "description": "", "name": "cb"}, "cond": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(p=0,\"has got a drive-thru window\" ,if(p=1,\"is open late (after 11pm)\",if(p=2,\"is located on a public transport route\",\"is located in a town centre\")))", "description": "", "name": "cond"}, "ansc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(3.82*se,3)", "description": "", "name": "ansc"}, "ansb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(cb)/2.64,3)", "description": "", "name": "ansb"}, "ind": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3,4,5,6)", "description": "", "name": "ind"}, "sval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.2..0.9#0.000001)", "description": "", "name": "sval"}}, "ungrouped_variables": ["cb", "sed", "cond", "sea", "ind", "pred", "sval", "tol", "thisrest", "thismany", "ansa", "ansb", "ansc", "ansd", "thatmany", "sv", "hascond", "q", "p", "si", "place", "se"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["

$X_1$

", "

$X_2$

", "

$X_3$

"], "displayColumns": 0, "distractors": ["", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [0, 0, 1], "marks": 0}], "type": "gapfill", "prompt": "

Which of these variables is an indicator variable?

\n

[[0]]

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

Based on a recent survey of some of the restaurants in the North-East, the following (edited) Minitab output was obtained:

\n

Regression Analysis: $y$ versus $x_1,\\;x_2,\\;x_3$

\n

The regression equation is: y = ********

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

Predictor

\n
\n

Coef

\n
\n

SE Coef

\n
\n

T

\n
\n

P

\n
\n

Constant

\n
\n

$A$

\n
\n

{sea}

\n
\n

3.887

\n
\n

0.002$

\n
\n

$x_1$

\n
\n

{cb}

\n
\n

$B$

\n
\n

-2.64

\n
\n

0.021

\n
\n

$x_2$

\n
\n

$C$

\n
\n

{se}

\n
\n

3.82

\n
\n

0.002

\n
\n

$x_3$

\n
\n

$D$

\n
\n

{sed}

\n
\n

2.53

\n
\n

0.024

\n
\n

s={sval}       R-sq= 92.1%      R-Sq(adj)=93.9%

\n

(i) Find the values of $A,\\;B,\\;C$ and $D$ to 3 decimal places.

\n

$A=\\;$[[0]],   $B=\\;$[[1]]

\n

$C=\\;$[[2]],   $D=\\;$[[3]]

\n

(ii) Write down the full fitted regression equation: 

\n

\\[Y = \\beta_0+ \\beta_1 X_1 + \\beta_2 X_2 + \\beta_3X_3 + \\epsilon,\\;\\;\\epsilon \\sim N(0,\\sigma^2)\\]

\n

$Y=\\;$[[4]]-$\\var{abs(cb)}X_1$+[[5]]$X_2$+[[6]]$X_3+\\epsilon$

\n

Note that you are given  the coefficient of $X_1$ from the Minitab table.

\n

Also find   $\\sigma^2=\\;$[[7]]  to 3 decimal places where $\\epsilon \\sim N(0,\\sigma^2)$

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

Predict sales for a restaurant with {thatmany} competitors, a population of {thismany} within 1 kilometre and that {hascond}.

\n

Enter the predicted value to one decimal place:

\n

$Y=\\;$[[0]]

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

It is thought that a fourth variable - customer satisfaction based on a recent survey - could also be a predictor of sales.

\n

Each of the restaurants was given an overall satisfaction rating by choosing one of the following in the survey:

\n

{sv[0]}   {sv[1]}   {sv[2]}   {sv[3]}   {sv[4]}   {sv[5]}

\n

How many indicator variables would need to be used here?: [[0]]

", "showCorrectAnswer": true, "marks": 0}], "statement": "

The management at {thisrest} propose the following model to predict sales  Y at their {place} branch.

\n

\\[Y = \\beta_0+ \\beta_1 X_1 + \\beta_2 X_2 + \\beta_3X_3 + \\epsilon\\]

\n

where 

\n

$X_1=\\;$number of competitors within one kilometre.

\n

$X_2=\\;$population within one kilometre (in 1000s).

\n

$X_3=\\;$ 1 if {cond}, 0 otherwise.

", "tags": ["ACE2013", "checked2015", "indicator variables", "minitab output", "multiple regression", "regression", "regression equation", "statistics"], "rulesets": {}, "preamble": {"css": ".minitab {\nfont-family: 'Courier', monospace;\n}", "js": ""}, "type": "question", "metadata": {"notes": "

09/02/2014:

\n

First draft. Based on an i-assess question for ACE.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Asking users to interpret a minitab output to give the coefficients of a multiple regression together with a prediction based on the subsequent equation.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a) $X_3$ is the indicator variable.

\n

b)

\n

\n

(i) The values of A, B, C and D are given by:

\n

A = 3.887 x SE Coef (A) = 3.887 x {sea} = {ansa} to 3 decimal places.

\n

B = Coef (B)/-2.64 = {cb}/-2.64 = {ansb} to 3 decimal places.

\n

C = 3.82 x SE Coef (C) = 3.82 x {se} = {ansc} to 3 decimal places.

\n

D = 2.53 x SE Coef (D) = 2.53 x {sed} = {ansd} to 3 decimal places.

\n

ii) The fitted regression equation is:

\n

\\[Y=\\var{ansa}-\\var{abs(cb)}X_1+\\var{ansc}X_2+\\var{ansd}X_3+\\epsilon\\] with $\\sigma^2=\\var{sval}^2=\\var{si}$ all to 3 decimal places.

\n

c)

\n

\n

Using the above fitted model where $X_1=\\var{thatmany}$ and $X_2= \\frac{\\var{thismany}}{1000}=\\var{thismany/1000}$ and since $X_3=\\var{q}$ as the restaurant {hascond} we find :

\n

\\[Y=\\var{ansa}-\\var{abs(cb)}\\times \\var{thatmany}+\\var{ansc}\\times \\var{thismany/1000}+\\var{ansd}\\times \\var{q}=\\var{pred}\\] to one decimal place.

\n

d)

\n

There are {ind} categories in the survey and so the number of indicator variables is {ind}-1={ind-1}.

"}, {"name": "Linear regression - find line of best fit given summary statistics, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol", "description": ""}, "r1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "repeat(round(normalsample(67,8)),n)", "name": "r1", "description": ""}, "spxy": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sxy-t[0]*t[1]/n", "name": "spxy", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "name": "a", "description": ""}, "ssq": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "name": "ssq", "description": ""}, "sc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "r1[ch]", "name": "sc", "description": ""}, "ch": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..7)", "name": "ch", "description": ""}, "b1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.25..0.45#0.05)", "name": "b1", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[sum(r1),sum(r2)]", "name": "t", "description": ""}, "a1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..20)", "name": "a1", "description": ""}, "sxy": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "name": "sxy", "description": ""}, "ss": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "name": "ss", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "8", "name": "n", "description": ""}, "obj": {"group": "Ungrouped variables", "templateType": "anything", "definition": "['A','B','C','D','E','F','G','H']", "name": "obj", "description": ""}, "r2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(round(a1+b1*x+random(-9..9)),x,r1)", "name": "r2", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(spxy/ss[0],3)", "name": "b", "description": ""}, "ls": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(a+b*sc,2)", "name": "ls", "description": ""}, "res": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(precround(r2[x]-(a+b*r1[x]),2),x,0..n-1)", "name": "res", "description": ""}, "tsqovern": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[t[0]^2/n,t[1]^2/n]", "name": "tsqovern", "description": ""}}, "ungrouped_variables": ["tsqovern", "a", "b", "obj", "r1", "r2", "ss", "res", "ssq", "ls", "n", "a1", "ch", "spxy", "t", "tol", "sc", "sxy", "b1"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "showQuestionGroupNames": false, "functions": {"pstdev": {"type": "number", "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "parameters": [["l", "list"]]}}, "parts": [{"marks": 0, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "b-tol", "maxValue": "b+tol", "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "a-tol", "maxValue": "a+tol", "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "steps": [{"type": "information", "showCorrectAnswer": true, "prompt": "

To find $\\beta_0$ and $\\beta_1$ you first find  $\\displaystyle \\beta_1 = \\frac{SPXY}{SSX}$ where:

\n

$\\displaystyle SPXY=\\sum xy - \\frac{(\\sum x)\\times (\\sum y)}{\\var{n}}$

\n

$\\displaystyle SSX=\\sum x^2 - \\frac{(\\sum x)^2}{\\var{n}}$

\n

Then $\\displaystyle \\beta_0= \\frac{1}{\\var{n}}\\left[\\sum y-\\beta_1 \\sum x\\right]$

\n

Now go back and fill in the values for $\\beta_0$ and $\\beta_1$.

\n

 

", "scripts": {}, "marks": 0}], "prompt": "

Calculate the equation of the best fitting regression line:

\n

\\[Y = \\beta_0 + \\beta_1  X.\\] Find $\\beta_0$ and $\\beta_1$ to 5 decimal places, then input them below to 3 decimal places. You will use these approximate values in the rest of the question. 

\n

$\\beta_1=\\;$[[0]],      $\\beta_0=\\;$[[1]] (both to 3 decimal places.)

\n

You are given the following information:

\n\n\n\n\n\n\n\n\n\n\n\n
First Test$(X)$$\\sum x=\\;\\var{t[0]}$$\\sum x^2=\\;\\var{ssq[0]}$
Later Score$(Y)$$\\sum y=\\;\\var{t[1]}$$\\sum y^2=\\;\\var{ssq[1]}$
\n

Also you are given $\\sum xy = \\var{sxy}$.

\n

Click on Show steps if you want more information on calculating $\\beta_0$ and $\\beta_1$. You will not lose any marks by doing so.

\n

 

", "stepsPenalty": 0}, {"showCorrectAnswer": true, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "prompt": "

What is the predicted Later score for employee $\\var{obj[ch]}$ in the First test?

\n

Use the values of $\\beta_0$ and $\\beta_1$ you input above.

\n

Enter the predicted Later score here: (to 2 decimal places)

", "minValue": "ls-0.01", "correctAnswerFraction": false, "marks": 1, "maxValue": "ls+0.01"}, {"marks": 0, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "res[ch]-0.01", "maxValue": "res[ch]+0.01", "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "steps": [{"type": "information", "showCorrectAnswer": true, "prompt": "\n

The residual value is given by:

\n

RESIDUAL = OBSERVED - FITTED.

\n

In this case the observed value for $\\var{obj[ch]}$ is $\\var{r2[ch]}$ and you get the fitted value by feeding the First test value  $\\var{r1[ch]}$ into the regression equation.

\n

 

\n", "scripts": {}, "marks": 0}], "prompt": "

Use the result above to calculate the residual value for employee $\\var{obj[ch]}$.

\n

Click on Show steps to see what is meant by the residual value if you have forgotten. You will not lose any marks by doing so.

\n

Residual value =  (to 2 decimal places).[[0]]

", "stepsPenalty": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\n

To monitor its staff appraisal methods, a personnel department compares the results of the tests carried out on employees at their first appraisal with an assessment score of the same individuals two years later. The resulting data are as follows:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Employee$\\var{obj[0]}$$\\var{obj[1]}$$\\var{obj[2]}$$\\var{obj[3]}$$\\var{obj[4]}$$\\var{obj[5]}$$\\var{obj[6]}$$\\var{obj[7]}$
First Test $(X)$$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$
Later Score $(Y)$$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$
\n\n", "tags": ["ACE2013", "checked2015", "cr1", "data analysis", "fitted value", "PSY2010", "regression", "residual value", "sc", "statistics"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

21/12/2012:

\n

Checked rounding, OK. Added tag cr1.

\n

Possible use of scenarios, so added tag sc.

\n

The array r2 generates the regression data which has an inbuilt noise via r1[x]+random(-9..9).

\n

 

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find a regression equation.

"}, "advice": ""}, {"name": "Multiple linear regression - decide which variable to exclude", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"p2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.01..0.6#0.001 except [p0,p1])", "description": "", "name": "p2"}, "p4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.005..0.2#0.001 except [p0,p1,p2,p3])", "description": "", "name": "p4"}, "data": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[[\"$\\\\beta_0$\",random(8..20#0.001),p0],[\"$\\\\beta_1$\",random(-8..-1#0.001),p1],\n [\"$\\\\beta_2$\",random(4..9#0.001),p2],[\"$\\\\beta_3$\",random(2..10#0.001),p3],\n [\"$\\\\beta_4$\",random(1..15#0.001),p4]]", "description": "", "name": "data"}, "p0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.005..0.03#0.001)", "description": "", "name": "p0"}, "p1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.005..0.3#0.001 except p0)", "description": "", "name": "p1"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(p)", "description": "", "name": "m"}, "p3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.005..0.2#0.001 except [p0,p1,p2])", "description": "", "name": "p3"}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(if(p[j]=m,1,0),j,0..3)", "description": "", "name": "mm"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "findinlist(p,m)+1", "description": "", "name": "v"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[p1,p2,p3,p4]", "description": "", "name": "p"}}, "ungrouped_variables": ["p2", "p3", "p0", "p1", "p4", "mm", "m", "p", "v", "data"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"findinlist": {"type": "number", "language": "javascript", "definition": "var r=0;\nfor(j=0;j < l.length;j++)\n {if(l[j]==m){r=j;}\n }\nreturn r;", "parameters": [["l", "list"], ["m", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"displayType": "radiogroup", "choices": ["

$X_1$

", "

$X_2$

", "

$X_3$

", "

$X_4$

"], "displayColumns": 0, "prompt": "

Which predictor variable would you exclude from the model before re-fitting in Minitab?

", "distractors": ["", "", "", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "mm", "marks": 0}], "statement": "

A multiple linear regression model of the form:

\n

\\[Y=\\beta_0+\\beta_1X_1+ \\beta_2X_2+\\beta_3X_3+\\beta_4X_4+\\epsilon \\]

\n

is fitted to some data in Minitab. The following table shows estimates of the parameters with associated $p$-values.

\n
{table(data,[\"Parameter\",\"Estimate\",\"p-Value\"])}
", "tags": ["ACE2013", "checked2015"], "rulesets": {}, "preamble": {"css": "/* left-align variables */\n#table td:first-child, #table th:first-child {\n text-align: center;\n}", "js": ""}, "type": "question", "metadata": {"notes": "

09/02/2014:

\n

First draft finished.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

A multiple linear regression model of the form:

\n

\\[Y=\\beta_0+\\beta_1X_1+ \\beta_2X_2+\\beta_3X_3+\\beta_4X_4+\\epsilon \\]

\n

is fitted to some data in Minitab which generates a table showing estimates of the parameters with associated $p$-values. Determine which variable to exclude first.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

You would choose to exclude the predictor variable which had the largest p-value.

\n

In this example we see that  $X_{\\var{v}}$ has the largest $p$-value $\\var{m}$ and  and we would exclude it as $\\var{m}>0.05$.

\n

"}, {"name": "Calculate centred moving averages", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol"}, "tothere3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=3,random(\"Mesa Airways.\",\"KiwiJet.\",\"Frontier Airlines.\",\"EasyAir.\",\"RyanJet.\",\"HorizonAir.\",\"SunCity Airlines.\",\"Air Caribe.\"),\"\")", "description": "", "name": "tothere3"}, "tothere": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1,random(\"Souter Lighthouse\", \"Washington Old Hall\",\"Gibside\",\"Cherryburn Cottage\",\"Lindisfarne Castle\",\"Oakhurst Cottage\",\"George Stephenson's Birthplace\",\"Holy Jesus Hospital\"),\"\")", "description": "", "name": "tothere"}, "nat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1, \" (a National Trust attraction).\", \"\")", "description": "", "name": "nat"}, "y8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ap8+2*(m8+j8+ja9)+ap9)/8", "description": "", "name": "y8"}, "tothere2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=2,random(\"small electrical store.\",\"local baker's.\",\"book shop.\",\"local farmer's produce store.\",\"local newsagent.\",\"small restaurant.\",\"local grocery store.\"),\"\")", "description": "", "name": "tothere2"}, "j8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "j7+random(20..60#10)", "description": "", "name": "j8"}, "ja9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja8+random(50..100#10)", "description": "", "name": "ja9"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1", "description": "", "name": "tol1"}, "ap9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ap8+random(20..50#10)", "description": "", "name": "ap9"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1,\"the number of visitors to \",if(ch=2,\"sales (in hundreds of pounds) at a \",if(ch=3,\"passenger numbers (in hundreds) for \",\"the number of orders taken at a \")))", "description": "", "name": "this"}, "y10": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(j8+2*(ja9+ap9+m9)+j9)/8", "description": "", "name": "y10"}, "ja7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(250..400#10)", "description": "", "name": "ja7"}, "y5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m7+2*(j7+ja8+ap8)+m8)/8", "description": "", "name": "y5"}, "m9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m8+random(10..50#10)", "description": "", "name": "m9"}, "ja8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja7+random(50..150#10)", "description": "", "name": "ja8"}, "y9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m8+2*(j8+ja9+ap9)+m9)/8", "description": "", "name": "y9"}, "y6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(j7+2*(ja8+ap8+m8)+j8)/8", "description": "", "name": "y6"}, "ch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "ch"}, "ap7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja7+random(400..600#10)", "description": "", "name": "ap7"}, "rows": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[[\"2007\",ja7,ap7,m7,j7],[\"2008\",ja8,ap8,m8,j8],[\"2009\",ja9,ap9,m9,j9]]", "description": "", "name": "rows"}, "ap8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ap7+random(30..70#10)", "description": "", "name": "ap8"}, "y3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ja7+2*(ap7+m7+j7)+ja8)/8", "description": "", "name": "y3"}, "tothere4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=4,random(\"satellite TV store.\",\"take-away restaurant.\",\"TV shopping channel.\"),\"\")", "description": "", "name": "tothere4"}, "m7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2500..3500#100)", "description": "", "name": "m7"}, "j9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "j8+random(20..60#10)", "description": "", "name": "j9"}, "y7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ja8+2*(ap8+m8+j8)+ja9)/8", "description": "", "name": "y7"}, "j7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(750..1050#50)", "description": "", "name": "j7"}, "m8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m7+random(20..70#10)", "description": "", "name": "m8"}, "y4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ap7+2*(m7+j7+ja8)+ap8)/8", "description": "", "name": "y4"}}, "ungrouped_variables": ["ch", "j8", "j9", "tothere3", "j7", "tothere4", "y9", "y8", "ap9", "y3", "y5", "y4", "y7", "y6", "rows", "m7", "tol", "m9", "m8", "ap8", "tothere2", "nat", "ap7", "ja8", "ja9", "this", "ja7", "tol1", "tothere", "y10"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y3+tol", "minValue": "y3-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y4+tol", "minValue": "y4-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y5+tol", "minValue": "y5-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y6+tol", "minValue": "y6-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y7+tol", "minValue": "y7-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y8+tol", "minValue": "y8-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y9+tol", "minValue": "y9-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y10+tol", "minValue": "y10-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Find the series of (centred) moving averages for these data and complete 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\n
Jan-MarApril-JuneJuly-SepOct-Dec
2007**[[0]][[1]]
2008[[2]][[3]][[4]][[5]]
2009[[6]][[7]]**
", "showCorrectAnswer": true, "marks": 0}], "statement": "

The following tables shows by quarter over the three years 2007, 2008, 2009 {This} {tothere} {nat} {tothere2} {tothere3} {tothere4} 

\n

{table(rows,[\" \",\"Jan-Mar\",\"Apr-June\",\"July-Sep\",\"Oct-Dec\"])}

", "tags": ["ACE2013", "centred moving averages", "checked2015", "moving average", "statistics", "time series"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

22/03/2014:

\n


Created from ACE i-assess question.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Centred moving averages.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Jan-MarApril-JuneJuly-SepOct-Dec
2007**$\\var{y3}$$\\var{y4}$
2008$\\var{y5}$$\\var{y6}$$\\var{y7}$$\\var{y8}$
2009$\\var{y9}$$\\var{y10}$**
\n

Let $Y_t$ denote the data table values so $Y_1=\\var{ja7},\\;Y_2=\\var{ap7} ,\\ldots, Y_{12}=\\var{j9}$

\n

Using the centred moving average formula for quarters:

\n

\\[Y^*_t=\\frac{Y_{t-2}+2(Y_{t-1}+Y_t+Y_{t+1})+Y_{t+2}}{8}\\] we obtain the values in the table above.

\n

Thus the moving average for Oct-Dec 2007 is:

\n

\\[\\frac{Y_{2}+2(Y_{3}+Y_4+Y_{5})+Y_{6}}{8}=\\frac{\\var{ap7} + 2 (\\var{m7} + \\var{j7} + \\var{ja8}) + \\var{ap8}}{8} = \\var{y4}\\]

\n

"}, {"name": "Calculate moving averages, perform linear regression and give seasonal adjustments, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"sdt2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(t2-mt2,1)", "description": "", "name": "sdt2"}, "ms1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(th1+f1+s1+m2+t2)/5", "description": "", "name": "ms1"}, "mf2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(t2+th2+f2+s2+m3)/5", "description": "", "name": "mf2"}, "st": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sat-om,2)", "description": "", "name": "st"}, "sdm2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(m2-mm2,1)", "description": "", "name": "sdm2"}, "f1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "th1+random(1..3)", "description": "", "name": "f1"}, "tms": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sm+st+sth+sf+ss)/5", "description": "", "name": "tms"}, "sdth1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th1-mth1,1)", "description": "", "name": "sdth1"}, "sds1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s1-ms1,1)", "description": "", "name": "sds1"}, "comm1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ms=0, \"Since the mean of the seasonal effects is 0, the adjusted seasonal effects are the same as the seasonal effects found above.\", \" \")", "description": "", "name": "comm1"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1", "description": "", "name": "tol1"}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "m1"}, "asth": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sth-ms,2)", "description": "", "name": "asth"}, "t3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(t2,m3)+random(1..2)", "description": "", "name": "t3"}, "s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "f1+random(1..2)", "description": "", "name": "s1"}, "sdf1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f1-mf1,1)", "description": "", "name": "sdf1"}, "ms": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tms,2)", "description": "", "name": "ms"}, "ti": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(16..19)", "description": "", "name": "ti"}, "thisdate": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16,\"Monday 28th April\",if(ti=17,\"Tuesday, 29th April\",if(ti=18,\"Thursday, 1st May\",\"Friday,2nd May\")))", "description": "", "name": "thisdate"}, "sumysquared": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mth1^2+mf1^2+ms1^2+mm2^2+mt2^2+mth2^2+mf2^2+ms2^2+mm3^2+mt3^2+mth3^2", "description": "", "name": "sumysquared"}, "sdm3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(m3-mm3,1)", "description": "", "name": "sdm3"}, "th3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(th2,t3)+random(1..2)", "description": "", "name": "th3"}, "estord": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(estal+estbe*ti+adj+0.00000001)", "description": "", "name": "estord"}, "t1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m1+random(1..3)", "description": "", "name": "t1"}, "f3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(f2,th3)+random(1..2)", "description": "", "name": "f3"}, "syy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sumysquared-11*meany^2", "description": "", "name": "syy"}, "sds2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s2-ms2,1)", "description": "", "name": "sds2"}, "thisday": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16 ,\"Monday\",if(ti=17 ,\"Tuesday\",if(ti=18,\"Thursday\",\"Friday\")))", "description": "", "name": "thisday"}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sas-om,2)", "description": "", "name": "ss"}, "mth1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m1+t1+th1+f1+s1)/5", "description": "", "name": "mth1"}, "testbe": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sumty-11*meany*meant)/110", "description": "", "name": "testbe"}, "sdth3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th3-mth3,1)", "description": "", "name": "sdth3"}, "m2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m1+random(0..2)", "description": "", "name": "m2"}, "mt2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(s1+m2+t2+th2+f2)/5", "description": "", "name": "mt2"}, "sf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(saf-om,2)", "description": "", "name": "sf"}, "sdt3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(t3-mt3,1)", "description": "", "name": "sdt3"}, "th2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(th1,t2)+random(1..2)", "description": "", "name": "th2"}, "mt3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(s2+m3+t3+th3+f3)/5", "description": "", "name": "mt3"}, "sat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdt2+sdt3)/2", "description": "", "name": "sat"}, "ast": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(st-ms,2)", "description": "", "name": "ast"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol"}, "saf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdf1+sdf2)/2", "description": "", "name": "saf"}, "sath": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((sdth1+sdth2+sdth3)/3,2)", "description": "", "name": "sath"}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(s1,f2)+random(1..2)", "description": "", "name": "s2"}, "m3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m2+random(0..2)", "description": "", "name": "m3"}, "mm2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(f1+s1+m2+t2+th2)/5", "description": "", "name": "mm2"}, "sth": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sath-om,2)", "description": "", "name": "sth"}, "testal": {"templateType": "anything", "group": "Ungrouped variables", "definition": "meany-estbe*meant", "description": "", "name": "testal"}, "mm3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(f2+s2+m3+t3+th3)/5", "description": "", "name": "mm3"}, "sumty": {"templateType": "anything", "group": "Ungrouped variables", "definition": "3*mth1+4*mf1+5*ms1+6*mm2+7*mt2+8*mth2+9*mf2+10*ms2+11*mm3+12*mt3+13*mth3", "description": "", "name": "sumty"}, "mf1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(t1+th1+f1+s1+m2)/5", "description": "", "name": "mf1"}, "mth3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m3+t3+th3+f3+s3)/5", "description": "", "name": "mth3"}, "mth2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m2+t2+th2+f2+s2)/5", "description": "", "name": "mth2"}, "om": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tom,3)", "description": "", "name": "om"}, "f2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(f1,th2)+random(1..2)", "description": "", "name": "f2"}, "sdf2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f2-mf2,1)", "description": "", "name": "sdf2"}, "tom": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdth1+sdf1+sds1+sdm2+sdt2+sdth2+sdf2+sds2+sdm3+sdt3+sdth3)/11", "description": "", "name": "tom"}, "sam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdm2+sdm3)/2", "description": "", "name": "sam"}, "comm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(om=0, \"Since the mean of the seasonal deviations is 0, these seasonal effects are the same as the seasonal means found above.\", \" \")", "description": "", "name": "comm"}, "asm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sm-ms,2)", "description": "", "name": "asm"}, "th1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t1+random(1..3)", "description": "", "name": "th1"}, "sm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sam-om,2)", "description": "", "name": "sm"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"A satellite TV store\",\"An electrical store\",\"A plasma TV shop\",\"A computer hardware store\",\"A furniture store\",\"A DIY store\")", "description": "", "name": "this"}, "t2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(t1,m2)+random(1..2)", "description": "", "name": "t2"}, "ass": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ss-ms,2)", "description": "", "name": "ass"}, "summa": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mth1+mf1+ms1+mm2+mt2+mth2+mf2+ms2+mm3+mt3+mth3", "description": "", "name": "summa"}, "asf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sf-ms,2)", "description": "", "name": "asf"}, "adj": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16 ,asm,if(ti=17,ast,if(ti=18,asth,asf)))", "description": "", "name": "adj"}, "estal": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(testal,2)", "description": "", "name": "estal"}, "meany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "summa/11", "description": "", "name": "meany"}, "estbe": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(testbe,2)", "description": "", "name": "estbe"}, "sas": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sds1+sds2)/2", "description": "", "name": "sas"}, "meant": {"templateType": "anything", "group": "Ungrouped variables", "definition": "8", "description": "", "name": "meant"}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(s2,f3)+random(1..2)", "description": "", "name": "s3"}, "sdth2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th2-mth2,1)", "description": "", "name": "sdth2"}, "ms2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(th2+f2+s2+m3+t3)/5", "description": "", "name": "ms2"}}, "ungrouped_variables": ["f1", "f2", "f3", "sdf2", "sdf1", "thisdate", "t2", "saf", "mm3", "mm2", "this", "mt2", "sas", "t1", "sat", "asth", "tms", "mth3", "sam", "mth1", "sdth3", "s3", "s2", "s1", "sds1", "th3", "th2", "th1", "m1", "m3", "tom", "sath", "sdm3", "adj", "thisday", "sdt3", "sdt2", "ass", "comm1", "tol", "tol1", "ast", "m2", "meany", "testal", "t3", "sdm2", "mf2", "comm", "asf", "sumysquared", "sdth1", "syy", "sm", "asm", "mth2", "testbe", "om", "sdth2", "summa", "estbe", "mf1", "meant", "sumty", "sth", "ms2", "ms1", "st", "ss", "ms", "mt3", "ti", "sds2", "sf", "estal", "estord"], "functions": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Complete the following table, showing the moving averages for the number of orders based on a five-observation cycle. The first one has been done for you. Input all moving averages to one decimal place.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{mth1}$[[0]][[1]]
14/4/08[[2]][[3]][[4]][[5]][[6]]
21/4/08[[7]][[8]][[9]]**
", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{mf1}", "maxValue": "{ms1}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ms1", "maxValue": "ms1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mm2", "maxValue": "mm2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mt2", "maxValue": "mt2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mth2", "maxValue": "mth2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mf2", "maxValue": "mf2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ms2", "maxValue": "ms2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mm3", "maxValue": "mm3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mt3", "maxValue": "mt3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mth3", "maxValue": "mth3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Fit the linear regression model $Y=\\alpha+\\beta T+\\epsilon$  to this set $Y$ of moving averages, where $T$ represents time. ($T=1$ for 7/4/08,  $T=2$ for 8/4/08,  $T=3$ for 10/4/08 etc.)

\n

You may use the following summaries:

\n

$\\sum t=88,\\;\\;\\sum y=\\var{summa},\\;\\;\\sum ty=\\var{sumty},\\;\\; \\sum t^2=814,\\;\\;\\sum y^2=\\var{sumysquared}$.

\n

Estimate for $\\beta= \\;$[[0]] (estimate to 2 decimal places).

\n

Estimate for $\\alpha= \\;$[[1]] (estimate to 2 decimal places). Use the estimate for $\\beta$ to 2 decimal places to estimate $\\alpha$.

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estbe-tol", "maxValue": "estbe+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estal-tol", "maxValue": "estal+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Complete the following table, showing the seasonal deviations and seasonal means for each day of the week:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**[[0]][[1]][[2]]
14/4/08[[3]][[4]][[5]][[6]][[7]]
21/4/08[[8]][[9]][[10]]**
Seasonal Mean[[11]][[12]][[13]][[14]][[15]]
\n

Input all entries to 2 decimal places.

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth1", "maxValue": "sdth1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdf1", "maxValue": "sdf1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sds1", "maxValue": "sds1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdm2", "maxValue": "sdm2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdt2", "maxValue": "sdt2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth2", "maxValue": "sdth2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdf2", "maxValue": "sdf2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sds2", "maxValue": "sds2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdm3", "maxValue": "sdm3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdt3", "maxValue": "sdt3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth3", "maxValue": "sdth3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sam", "maxValue": "sam", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sat", "maxValue": "sat", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sath-tol", "maxValue": "sath+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "saf", "maxValue": "saf", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sas", "maxValue": "sas", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the (unadjusted) seasonal effects for each day of the week: (input all your answers to 2 decimal places).

\n

Seasonal effect for Monday:   $S_M=\\;$    [[0]]                     

\n

Seasonal effect for Tuesday:   $S_T=\\;$ [[1]]

\n

Seasonal effect for Thursday:   $S_{Thu}=\\;$  [[2]]     

\n

Seasonal effect for Friday:        $S_F=\\;$ [[3]]

\n

Seasonal effect for Saturday:    $S_{Sa}=\\;$ [[4]]

\n

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sm-tol", "maxValue": "sm+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "st-tol", "maxValue": "st+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sth-tol", "maxValue": "sth+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sf-tol", "maxValue": "sf+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ss-tol", "maxValue": "ss+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the adusted seasonal effects for each day of the week: (input all your answers to 2 decimal places).

\n

Adjusted seasonal effect for Monday:   $S_M=\\;$    [[0]]                     

\n

Adjusted seasonal effect for Tuesday:   $S_T=\\;$ [[1]]

\n

Adjusted seasonal effect for Thursday:   $S_{Thu}=\\;$  [[2]]     

\n

Adjusted seasonal effect for Friday:        $S_F=\\;$ [[3]]

\n

Adjusted seasonal effect for Saturday:    $S_{Sa}=\\;$ [[4]]

\n

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asm-tol", "maxValue": "asm+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ast-tol", "maxValue": "ast+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asth-tol", "maxValue": "asth+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asf-tol", "maxValue": "asf+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ass-tol", "maxValue": "ass+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Use the regression equation in part 2 and the adjusted seasonal effects in part 5 to forecast the number of orders on {thisdate}

\n

Estimated orders on {thisdate} = ?[[0]]  (input to the nearest whole number)

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estord-tol1", "maxValue": "estord+tol1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 2, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "

{This} has recently opened for business and is open  5 days a week, Monday, Tuesday, Thursday, Friday and Saturday. The number of orders each day during the first three weeks of business is shown below:

\n

{table([[\"7/4/08\",{m1},{t1},{th1},{f1},{s1}],[\"14/4/08\",{m2},{t2},{th2},{f2},{s2}],[\"21/4/08\",{m3},{t3},{th3},{f3},{s3}]],[\" \",\"Mon\",\"Tues\",\"Thur\",\"Fri\",\"Sat\"])}

\n

", "tags": ["checked2015", "forecasting", "moving averages", "regression", "seasonal adjustments", "seasonality", "statistics", "time series"], "rulesets": {}, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Moving averages, regression and seasonal adjustments.

"}, "advice": "

a)

\n

 The completed moving average table is as follows:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{mth1}$$\\var{mf1}$$\\var{ms1}$
14/4/08$\\var{mm2}$$\\var{mt2}$$\\var{mth2}$$\\var{mf2}$$\\var{ms2}$
21/4/08$\\var{mm3}$$\\var{mt3}$$\\var{mth3}$**
\n

b)

\n

The mean value of $T$ is $\\overline{t}=\\frac{3+4+\\cdots+13}{11}=\\frac{88}{11}=8$.

\n

The mean value of $Y$ is $\\overline{y}=\\frac{\\var{summa}}{11}=\\var{meany}$.

\n

We have:

\n

\\[\\begin{align}S_{TY}&=\\sum ty-11\\overline{t}\\overline{y}=\\var{sumty}-11\\times 8 \\times\\var{ meany}\\\\
S_{YY}&=\\sum y^2-11\\overline{y}^2=\\var{sumysquared}-11\\var{meany}^2=\\var{syy}\\\\
S_{TT}&=\\sum t^2-11\\overline{t}^2=814-11\\times 64=110
\\end{align}\\]

\n

Estimate for $\\beta$ is $\\frac{S_{TY}}{S_{TT}}=\\var{testbe}=\\var{estbe}$ to 2 decimal places.

\n

Estimate for $\\alpha$ is $\\overline{y}-\\beta\\overline{t}=\\var{meany}-\\var{estbe}\\times\\var{meant}=\\var{testal}=\\var{estal}$ to 2 decimal places.

\n

So the linear regression equation is $Y=\\simplify{{estal}+{estbe}T}+\\epsilon$ coefficients to 2 decimal places.

\n

c)

\n

The following table shows the calculated seasonal deviations and seasonal means for each day of the week. These are obtained by taking the moving average data away from the original data on orders. The seasonal means for the days are obtained by taking the means in each column.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{sdth1}$$\\var{sdf1}$$\\var{sds1}$
14/4/08$\\var{sdm2}$$\\var{sdt2}$$\\var{sdth2}$$\\var{sdf2}$$\\var{sds2}$
21/4/08$\\var{sdm3}$$\\var{sdt3}$$\\var{sdth3}$**
Seasonal Mean$\\var{sam}$$\\var{sat}$$\\var{sath}$$\\var{saf}$$\\var{sas}$
\n

d) The seasonal effects for each day of the week are calculated by first finding the means of all the seasonal deviations found in the last table (not including the seasonal means in the last row). Then you take this away from the seasonal mean for each day.

\n

We find that the mean of the seasonal deviations is:

\n

\\[\\simplify[all,!collectNumbers]{({sdth1} + {sdf1} + {sds1} + {sdm2} + {sdt2} + {sdth2} + {sdf2} + {sds2} + {sdm3} + {sdt3} + {sdth3}) / 11} = \\var{om}\\]to 3 decimal places.

\n

{comm}

\n

Seasonal effect for Monday: $S_M=\\;\\simplify[all,!collectNumbers]{{sam}-{om}}=\\var{sm}$ to 2 decimal places.

\n

Seasonal effect for Tuesday: $S_T=\\simplify[all,!collectNumbers]{{sat}-{om}}=\\var{st}$ to 2 decimal places.

\n

Seasonal effect for Thursday: $S_{Thu}=\\simplify[all,!collectNumbers]{{sath}-{om}}=\\var{sth}$ to 2 decimal places.

\n

Seasonal effect for Friday: $S_F=\\simplify[all,!collectNumbers]{{saf}-{om}}=\\var{sf}$ to 2 decimal places.

\n

Seasonal effect for Saturday: $S_{Sa}=\\simplify[all,!collectNumbers]{{sas}-{om}}=\\var{ss}$ to 2 decimal places.

\n

e)

\n

We further adjust the seasonal effects for each day by finding the mean of the seasonal effects we have just found and then taking this away from each of the seasonal effects.

\n

We find that the mean of the seasonal deviations is:

\n

\\[\\simplify[all,!collectNumbers]{({sm} + {st} + {sth} + {sf} + {ss} ) / 5} = \\var{ms}\\] to 3 decimal places.

\n

{comm1}

\n

Adjusted seasonal effect for Monday $\\;=\\simplify[all,!collectNumbers]{{sm}-{ms}}=\\var{asm}$ to 2 decimal places.

\n

Adjusted seasonal effect for Tuesday$\\;=\\simplify[all,!collectNumbers]{{st}-{ms}}=\\var{ast}$ to 2 decimal places.

\n

Adjusted seasonal effect for Thursday$\\;=\\simplify[all,!collectNumbers]{{sth}-{ms}}=\\var{asth}$ to 2 decimal places.

\n

Adjusted seasonal effect for Friday$\\;=\\simplify[all,!collectNumbers]{{sf}-{ms}}=\\var{asf}$ to 2 decimal places.

\n

Adjusted seasonal effect for Saturday $\\;=\\simplify[all,!collectNumbers]{{ss}-{ms}}=\\var{ass}$ to 2 decimal places.

\n

f)

\n

We use the regression equation found above  $Y=\\simplify[all,!collectNumbers]{{estal}+{estbe}T}+\\epsilon$  to estimate the number of orders on {thisdate}.

\n

\n

But we have to adjust for seasonality using the adjusted seasonal effect found above by adding on the adjusted seasonal effect for {thisday} i.e. $\\var{adj}$.

\n

Note that $T=1$ corresponds to 7/4/08 and hence $T=\\var{ti}$ for {thisdate}.

\n

So putting $T=\\var{ti}$ gives  $Y=\\simplify[all,!collectNumbers]{{estal}+{estbe}*{ti}+{adj}}=\\var{estal+estbe*ti+adj}=\\var{estord}$  orders to the nearest whole number.

\n

\n

"}, {"name": "Choose most appropriate model from Minitab output of AR(1) model and AR(2) stationary series", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"w": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "name": "w"}, "est22": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,random(0.075..0.110#0.005),random(0.305..0.455#0.005))", "description": "", "name": "est22"}, "thismany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(250..500#10)", "description": "", "name": "thismany"}, "thatmany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,me,thismany+random(20..50))", "description": "", "name": "thatmany"}, "flse": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=2, \"AR(1)\", \"AR(2)\")", "description": "", "name": "flse"}, "flser22": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=2,\"retain this hypothesis\",\"reject this hypothesis\")", "description": "", "name": "flser22"}, "flse221": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"slight evidence against\"", "description": "", "name": "flse221"}, "est11": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.255..0.455#0.005)", "description": "", "name": "est11"}, "correct22": {"templateType": "anything", "group": "Ungrouped variables", "definition": "If(t=1,if(w=1,\"slight evidence against\", \"no evidence against\"),\"moderate evidence against\")", "description": "", "name": "correct22"}, "me1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(50..250#10)", "description": "", "name": "me1"}, "thisno": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,\"\",\"two\")", "description": "", "name": "thisno"}, "forc1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((me1+est11*(thismany-me1)),2)", "description": "", "name": "forc1"}, "p11": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(v=1, random(0.005..0.009#0.001),random(0.015..0.045#0.005))", "description": "", "name": "p11"}, "flse321": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"no evidence against\"", "description": "", "name": "flse321"}, "q1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(u=1,0.01,0.05)", "description": "", "name": "q1"}, "me": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,me1,me2)", "description": "", "name": "me"}, "ine": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1, \"\\\\>\",\"\\\\<\")", "description": "", "name": "ine"}, "est12": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.255..0.455#0.005)", "description": "", "name": "est12"}, "that": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,\"\",thatmany)", "description": "", "name": "that"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "name": "t"}, "p22": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,if(w=1,random(0.06..0.095#0.005),random(0.15..0.555#0.005)),random(0.015..0.045#0.005))", "description": "", "name": "p22"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "name": "v"}, "p12": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(u=1, random(0.005..0.009#0.001),random(0.015..0.045#0.005))", "description": "", "name": "p12"}, "flse222": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,if(w=1,\"no evidence against\",\"moderate evidence against\"), \"slight evidence against\")", "description": "", "name": "flse222"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "name": "u"}, "correct11": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(v=1, \"strong evidence against\",\"moderate evidence against\")", "description": "", "name": "correct11"}, "an": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,\"\",\"and the one before that \")", "description": "", "name": "an"}, "correct": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1, \"AR(1)\", \"AR(2)\")", "description": "", "name": "correct"}, "me2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "me1+random(-20,-10,10,20)", "description": "", "name": "me2"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,est11,est12)", "description": "", "name": "p"}, "correct21": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(u=1, \"strong evidence against\", \"moderate evidence against\")", "description": "", "name": "correct21"}, "flse211": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"slight evidence against\"", "description": "", "name": "flse211"}, "flse111": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"no evidence against\"", "description": "", "name": "flse111"}, "flse322": {"templateType": "anything", "group": "Ungrouped variables", "definition": "If(t=1,if(w=1,\"moderate evidence against\", \"slight evidence against\"),\"no evidence against\")", "description": "", "name": "flse322"}, "flse311": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(v=2, \"strong evidence against\",\"moderate evidence against\")", "description": "", "name": "flse311"}, "correctr22": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,\"retain this hypothesis\",\"reject this hypothesis\")", "description": "", "name": "correctr22"}, "q3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(v=1,0.01,0.05)", "description": "", "name": "q3"}, "y": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,0,est22)", "description": "", "name": "y"}, "s": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,\"\",\"s\")", "description": "", "name": "s"}, "q2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,if(w=1,0.05,0.1),0.05)", "description": "", "name": "q2"}, "flse122": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"strong evidence against\"", "description": "", "name": "flse122"}, "flse121": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(u=1,\"moderate evidence against\",\"strong evidence against\")", "description": "", "name": "flse121"}, "forc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,forc1,precround((me2+est12*(thismany-me2)+est22*(thatmany-me2)),2))", "description": "", "name": "forc"}}, "ungrouped_variables": ["est12", "est11", "flse122", "p22", "an", "me1", "me2", "ine", "flse", "flse121", "q1", "q3", "q2", "correct11", "flse111", "flse221", "flse222", "flse321", "flse322", "tol", "correct", "est22", "that", "forc", "correctr22", "thisno", "forc1", "p11", "p12", "me", "thismany", "flse311", "thatmany", "flser22", "correct21", "flse211", "correct22", "p", "s", "u", "t", "w", "v", "y"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "me1", "minValue": "me1", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "est11", "minValue": "est11", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "me1", "minValue": "me1", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "me2", "minValue": "me2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "est12", "minValue": "est12", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "me2", "minValue": "me2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "est22", "minValue": "est22", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "me2", "minValue": "me2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Write down the full estimated AR(1) and AR(2) models:

\n

$\\text{AR(1)}:\\;\\;Y_t=a_1+b_1(Y_{t-1}-c_1)+\\epsilon_t$

\n

Find $a_1=\\;$[[0]]    $b_1=\\;$[[1]]    $c_1=\\;$[[2]]

\n

$\\text{AR(2)}:\\;\\;Y_t=a_2+b_2(Y_{t-1}-c_2)+d_2(Y_{t-2}-e_2)+\\epsilon_t$

\n

Find $a_2=\\;$[[3]],    $b_2=\\;$[[4]],   $c_2=\\;$[[5]],   $d_2=\\;$[[6]],   $e_2=\\;$[[7]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["

{Correct21}

", "

{Flse121}

", "

{Flse221}

", "

{Flse321}

"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0, 0, 0], "marks": 0}, {"displayType": "radiogroup", "choices": ["

retain this hypothesis

", "

reject this hypothesis

"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [0, 1], "marks": 0}, {"displayType": "radiogroup", "choices": ["

{Correct22}

", "

{Flse122}

", "

{Flse222}

", "

{Flse322}

"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0, 0, 0], "marks": 0}, {"displayType": "radiogroup", "choices": ["

{Correctr22}

", "

{Flser22}

"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0], "marks": 0}], "type": "gapfill", "prompt": "

For the AR(2) fit, choose one of the following:

\n

1) For the null hypothesis $\\text{H}_0:\\;\\alpha_1=0$  there is:

\n

[[0]]

\n

So we:

\n

[[1]]

\n

2) For the null hypothesis $\\text{H}_0:\\;\\alpha_2=0$  there is:

\n

[[2]]

\n

So we:

\n

[[3]]

\n

\n

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["

{Correct11}

", "

{Flse111}

", "

{Flse211}

", "

{Flse311}

"], "displayColumns": 0, "distractors": ["", "", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0, 0, 0], "marks": 0}, {"displayType": "radiogroup", "choices": ["

retain this hypothesis

", "

reject this hypothesis

"], "displayColumns": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [0, 1], "marks": 0}], "type": "gapfill", "prompt": "

For the AR(1) fit, choose one of the following:

\n

For the null hypothesis $\\text{H}_0:\\;\\alpha_1=0$  there is:

\n

[[0]]

\n

So we:

\n

[[1]]

\n

", "showCorrectAnswer": true, "marks": 0}, {"displayType": "radiogroup", "choices": ["

{Correct}

", "

{Flse}

"], "displayColumns": 0, "prompt": "

Which of the two models seems most appropriate here?

", "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0], "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "forc+tol", "minValue": "forc-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Using the most appropriate model as identified in the last part, forecast the next value in the series if the last value was $\\var{thismany}$ {an} $\\var{that}$.

\n

Forecast= [[0]] (enter to 2 decimal places.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Minitab was used to fit both an AR(1) model and an AR(2) to a stationary series. The following table summarises the results obtained:

\n

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
AR(1) ModelAR(2) Model
ParameterEstimatep-ValueEstimatep-Value
$\\alpha_1${est11}{p11}{est12}{p12}
$\\alpha_2$$\\ldots$$\\ldots${est22}{p22}
$\\mu${me1}$\\ldots${me2}$\\ldots$
", "tags": ["ACE2013", "AR(1)", "AR(1) model", "AR(2)", "AR(2) model", "ARMA", "autoregression", "autoregressive", "checked2015", "forecast", "forecasting", "Minitab output", "minitab output", "models", "p values", "stationary series", "stationary time series", "statistics", "time series"], "rulesets": {}, "preamble": {"css": ".minitab {\nfont-family: 'Courier', monospace;\n}", "js": ""}, "type": "question", "metadata": {"notes": "

23/03/2014:

\n

Created.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Minitab was used to fit both an AR(1) model and an AR(2) to a stationary series. A  table is given summarising the results obtained from Minitab. Choose the most appropriate model and make a forecast based on that model.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a) Using the data given we have the models are given by:

\n

AR(1): 

\n

\\[Y_t=a_1+b_1(Y_{t-1}-c_1)+\\epsilon_t\\]

\n

where $a_1=\\var{me1},\\;\\;b_1=\\alpha_1=\\var{est11},\\;\\;c_1=\\var{me1}$

\n

AR(2):

\n

\\[Y_t=a_2+b_2(Y_{t-1}-c_2)+d_2(Y_{t-2}-e_2)+\\epsilon_t\\]

\n

where $a_2=\\var{me2},\\;\\;b_2=\\alpha_1=\\var{est12},\\;\\;c_2=\\var{me2},\\;\\;d_2=\\alpha_2=\\var{est22},\\;\\;e_2=\\var{me2}$

\n

b)

\n

Using the above diagram for making decisions on retaining or rejecting the hypotheses on the coefficients we see that:

\n

For the AR(2) fit:

\n

$\\var{est12}$ has a p-value of $\\var{p12}$ and so there is {Correct21} the hypothesis that $\\text{H}_0:\\;\\alpha_1=0$ . So we reject this hypothesis.

\n

 $\\var{est22}$ has a p-value of $\\var{p22}$ and so there is {Correct22} the hypothesis that $\\text{H}_0:\\;\\alpha_2=0$ . So we {Correctr22}.

\n

c)

\n

For the AR(1) fit:

\n

 $\\alpha_1=\\var{est11}$ has a p-value of $\\var{p11} \\lt \\var{q3}$ and so there is {Correct11} the hypothesis that  $\\text{H}_0:\\;\\alpha_1=0$ .

\n

So we reject this hypothesis.

\n

d)

\n

We see that since in either case we reject the hypothesis that $\\alpha_1=0$ , but that for the AR(2) model we {Correctr22}  that $\\alpha_2=0$  , so we choose the {Correct} model as the most appropriate one.

\n

e)

\n

Using the {Correct} model we have the forecast for the next period:

\n

Forecast =$ \\simplify[all,!collectNumbers]{{me}+{p}({thismany}-{me})+{y}({thatmany}-{me})}=\\var{forc}$ to 2 decimal places.

\n

\n

\n

"}, {"name": "Interpret Minitab output of AR(1) model", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"fo": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(fo1=me, fo1+random(40..60),fo1)", "description": "", "name": "fo"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol"}, "fo1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(u*(me-2*mese)+(100-u)*(me+2*mese))/100", "description": "", "name": "fo1"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(2.18*sea,2)", "description": "", "name": "a"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(-0.12*sed,2)", "description": "", "name": "c"}, "sea": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.05..0.45#0.05)", "description": "", "name": "sea"}, "fo3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(afo3,2)", "description": "", "name": "fo3"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..100)", "description": "", "name": "u"}, "afo4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "me+a*(fo3-me)", "description": "", "name": "afo4"}, "sed": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..150#5)", "description": "", "name": "sed"}, "per": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(25..70)", "description": "", "name": "per"}, "afo3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "me+a*(fo2-me)", "description": "", "name": "afo3"}, "me": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(50..150#10)", "description": "", "name": "me"}, "fo2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(afo2,2)", "description": "", "name": "fo2"}, "fo4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(afo4,2)", "description": "", "name": "fo4"}, "afo2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "me+a*(fo -me)", "description": "", "name": "afo2"}, "mese": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(100..300#10)", "description": "", "name": "mese"}}, "ungrouped_variables": ["me", "a", "c", "fo1", "afo2", "fo2", "fo3", "per", "afo4", "sed", "u", "mese", "tol", "afo3", "fo4", "sea", "fo"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "a+tol", "minValue": "a-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "c+tol", "minValue": "c-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Input the values of X and Y:

\n

X= [[0]]  (to 2 decimal places).

\n

Y= [[1]]  (to 2 decimal places).

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

The estimated model has the following form:

\n

\\[Y_t=a+b(Y_{t-1}-c)+\\epsilon_t\\]

\n

Find $a=\\;$[[0]]    $b=\\;$[[1]]    $c=\\;$[[2]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "fo2", "minValue": "fo2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "fo3", "minValue": "fo3", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "fo4", "minValue": "fo4", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Use your model above to complete the following (edited ) output from Minitab:

\n

(Calculate each forecast to 2 decimal places, then use this value to 2 decimal places  to calculate the next forecast.)

\n


Forecast from period {per}:

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
PeriodForecast
{per+1}{fo}
{per+2}[[0]]
{per+3}[[1]]
{per+4}[[2]]
\n

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Minitab was used to fit an AR(1) model to a stationary series. The following output was obtained:

\n

\n

FINAL ESTIMATE OF PARAMETERS

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TypeCoefSE CoefTP
AR 1X{sea}2.180.034
ConstantY{sed}-0.120.902
Mean{me}{mese}
", "tags": ["ACE2013", "AR(1)", "AR(1) model", "ARMA", "autoregression", "autoregressive", "checked2015", "forecast", "forecasting", "Minitab output", "minitab output", "models", "stationary series", "stationary time series", "statistics", "time series"], "rulesets": {}, "preamble": {"css": ".minitab {\nfont-family: 'Courier', monospace;\n}", "js": ""}, "type": "question", "metadata": {"notes": "

22/03/2014:

\n

Created.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Minitab was used to fit an AR(1) model to a stationary time series. Given the output answer the following questions about the model and use the model to make forecasts.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

From the table we have $\\displaystyle \\frac{X}{\\var{sea}}=2.18$.

\n

Hence we find $X=\\var{sea}\\times 2.18=\\var{a}$ to 2 decimal places.

\n

Similarly we have  $\\displaystyle \\frac{Y}{\\var{sed}}=-0.12$

\n

Hence we find $Y=\\var{sed}\\times -0.12=\\var{c}$ to 2 decimal places.

\n

b)

\n

The model is 

\n

\\[Y_t= \\var{me}+\\var{a}(Y_{t-1}-\\var{me})+\\epsilon_t.\\]

\n

So $a=\\var{me},\\;\\;b=\\var{a},\\;\\;c=\\var{me}$.

\n

c)

\n

Putting $Y_{\\var{per+1}}=\\var{fo1}$ we find:

\n

\\[Y_{\\var {per + 2}} = \\var{me} + \\var{a}  (Y_{\\var{per + 1}} -\\var{me}) = \\var{me} + \\var{a} \\times (\\var{fo1} -\\var{me}) = \\var{fo2}\\] to 2 decimal places.

\n

Using this value to 2dps we have:

\n

\\[Y_{\\var {per + 3}} = \\var{me} + \\var{a}  (Y_{\\var{per + 2}} -\\var{me}) = \\var{me} + \\var{a} \\times (\\var{fo2} -\\var{me}) = \\var{fo3}\\] to 2 decimal places.

\n

Finally using this last value we have:

\n

\\[Y_{\\var {per + 4}} = \\var{me} + \\var{a}  (Y_{\\var{per + 3}} -\\var{me}) = \\var{me} + \\var{a} \\times (\\var{fo3} -\\var{me}) = \\var{fo4}\\] to 2 decimal places.

\n

In summary we have.

\n

Forecast from period {per}:

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
PeriodForecast
{per+1}{fo1}
{per+2}{fo2}
{per+3}{fo3}
{per+4}{fo4}
"}], "name": "", "pickQuestions": 0}], "name": "Statistics for marketing and management", "showQuestionGroupNames": false, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Questions used in a university course titled \"Statistics for marketing and management\""}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "extensions": ["jsxgraph", "stats"], "custom_part_types": [], "resources": []}