// Numbas version: finer_feedback_settings {"name": "First Test Quiz", "metadata": {"description": "
Mitchum's first test quiz.
", "licence": "None specified"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", ""], "questions": [{"name": "Mitchum's copy of CI for a difference of means: embryonic stem cells", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}, {"name": "Mitchum Bock", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5103/"}], "tags": [], "metadata": {"description": "Adapted from section 7.3.1 in OpenIntro Statistics (4th ed).
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "We are interested in whether treatment using embryonic stem cells (ESCs) improves heart function following a heart attack. The table below reports the change in heart pumping capacity (compared to pre attack, as percentage) for a group of subjects that received ESCs and for a control group. Subject assignment to the groups was random.
\nECS | \ncontrol | \n
{r1[0]} | \n{r2[0]} | \n
{r1[1]} | \n{r2[1]} | \n
{r1[2]} | \n{r2[2]} | \n
{r1[3]} | \n{r2[3]} | \n
{r1[4]} | \n{r2[4]} | \n
{r1[5]} | \n{r2[5]} | \n
{r1[6]} | \n{r2[6]} | \n
{r1[7]} | \n{r2[7]} | \n
{r1[8]} | \n{r2[8]} | \n
See section 7.3.1 in OpenIntro Statistics.
", "rulesets": {}, "variables": {"sd1": {"name": "sd1", "group": "Statistics", "definition": "stdev(r1,true)", "description": "", "templateType": "anything"}, "mean2": {"name": "mean2", "group": "Statistics", "definition": "mean(r2)", "description": "", "templateType": "anything"}, "tol": {"name": "tol", "group": "Setup", "definition": "0.05", "description": "", "templateType": "anything"}, "sigma1": {"name": "sigma1", "group": "Setup", "definition": "random(4.5..5.5#0.1)", "description": "", "templateType": "anything"}, "mu1": {"name": "mu1", "group": "Setup", "definition": "random(2.5..4.5#0.1)", "description": "Population mean of sample 1.
", "templateType": "anything"}, "r2": {"name": "r2", "group": "Setup", "definition": "repeat(round(normalsample(mu2,sigma2)),n2)", "description": "", "templateType": "anything"}, "SE": {"name": "SE", "group": "Statistics", "definition": "siground(sqrt(sd1^2/n1+sd2^2/n2),3)", "description": "", "templateType": "anything"}, "sd2": {"name": "sd2", "group": "Statistics", "definition": "stdev(r2,true)", "description": "", "templateType": "anything"}, "mu2": {"name": "mu2", "group": "Setup", "definition": "random(-4.5..-2.5#0.1)", "description": "Population mean of sample 2.
", "templateType": "anything"}, "n2": {"name": "n2", "group": "Setup", "definition": "9", "description": "", "templateType": "anything"}, "ciLower": {"name": "ciLower", "group": "Statistics", "definition": "siground(meanDiff-tStar*SE,3)", "description": "", "templateType": "anything"}, "mean1": {"name": "mean1", "group": "Statistics", "definition": "mean(r1)", "description": "", "templateType": "anything"}, "r1": {"name": "r1", "group": "Setup", "definition": "repeat(round(normalsample(mu1,sigma1)),n1)", "description": "", "templateType": "anything"}, "n1": {"name": "n1", "group": "Setup", "definition": "9", "description": "", "templateType": "anything"}, "sigma2": {"name": "sigma2", "group": "Setup", "definition": "random(2..3#0.1)", "description": "", "templateType": "anything"}, "tStar": {"name": "tStar", "group": "Statistics", "definition": "studenttinv(0.5*(100-CL)/100,n1-1)", "description": "", "templateType": "anything"}, "CL": {"name": "CL", "group": "Setup", "definition": "random(90,95,99)", "description": "Confidence level.
", "templateType": "anything"}, "meanDiff": {"name": "meanDiff", "group": "Statistics", "definition": "siground(mean1-mean2,3)", "description": "", "templateType": "anything"}, "ciUpper": {"name": "ciUpper", "group": "Statistics", "definition": "siground(meanDiff+tStar*SE,3)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Setup", "variables": ["n1", "n2", "mu1", "mu2", "sigma1", "sigma2", "r1", "r2", "CL", "tol"]}, {"name": "Statistics", "variables": ["mean1", "mean2", "meanDiff", "SE", "sd1", "sd2", "tStar", "ciLower", "ciUpper"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "Calculate the following point estimate:
\n$\\overline{x}_{ESC}-\\overline{x}_{control}=$ [[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "(meanDiff)*(1-tol)", "maxValue": "(meanDiff)*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "Calculating the standard error:
\n$SE=$ [[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [{"variable": "sd1", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": "1", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "SE*(1-tol)", "maxValue": "SE*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "Calculate the $\\var{CL}\\%$ confidence interval for the mean difference in heart pumping capacity.
\nLower limit: [[0]]
\nUpper limit: [[1]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "ciUpper*(1-tol)", "maxValue": "ciUpper*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "ciLower*(1-tol)", "maxValue": "ciLower*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "type": "question"}, {"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}}$
\nThen $\\displaystyle \\beta_0= \\frac{1}{\\var{n}}\\left[\\sum y-\\beta_1 \\sum x\\right]$
\nNow 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.)
\nYou are given the following information:
\nFirst Test$(X)$ | \n$\\sum x=\\;\\var{t[0]}$ | \n$\\sum x^2=\\;\\var{ssq[0]}$ | \n
---|---|---|
Later Score$(Y)$ | \n$\\sum y=\\;\\var{t[1]}$ | \n$\\sum y^2=\\;\\var{ssq[1]}$ | \n
Also you are given $\\sum xy = \\var{sxy}$.
\nClick 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?
Use the values of $\\beta_0$ and $\\beta_1$ you input above.
\nEnter 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": "\nThe residual value is given by:
\nRESIDUAL = OBSERVED - FITTED.
\nIn 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]}$.
\nClick 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.
\nResidual value = (to 2 decimal places).[[0]]
", "stepsPenalty": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\nTo 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:
\nEmployee | $\\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)$ | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n
Later Score $(Y)$ | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n$\\var{r2[5]}$ | \n$\\var{r2[6]}$ | \n$\\var{r2[7]}$ | \n
21/12/2012:
\nChecked rounding, OK. Added tag cr1.
\nPossible use of scenarios, so added tag sc.
\nThe 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": ""}]}], "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "type": "exam", "contributors": [{"name": "Mitchum Bock", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5103/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}