// Numbas version: finer_feedback_settings {"name": "Michael's copy of Catherine's copy of Pearson1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "tags": [], "variables": {"r1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "darr(n,m,[random(1..20)])", "name": "r1"}, "sxy": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "name": "sxy"}, "tsqovern": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "[t[0]^2/n,t[1]^2/n]", "name": "tsqovern"}, "spcoef": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(6*ssd/(n*(n^2-1)),3)", "name": "spcoef"}, "spxy": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "sxy-t[0]*t[1]/n", "name": "spxy"}, "corrcoef": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(spxy/sqrt(ss[0]*ss[1]),3)", "name": "corrcoef"}, "ssq": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "name": "ssq"}, "vs": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "switch(spcoef >=0.952,[1,0,0,0,0],spcoef>=0.881,[0,1,0,0,0],spcoef>=0.738,[0,0,1,0,0],spcoef>=0.643,[0,0,0,1,0],[0,0,0,0,1])", "name": "vs"}, "ssd": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "sum(map(x^2,x,d))", "name": "ssd"}, "rr2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "rk(r2)", "name": "rr2"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "[sum(r1),sum(r2)]", "name": "t"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "8", "name": "n"}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "name": "ss"}, "obj": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "['A','B','C','D','E','F','G','H']", "name": "obj"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "20", "name": "m"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "switch(corrcoef >=0.905,[1,0,0,0,0],corrcoef>=0.834,[0,1,0,0,0],corrcoef>=0.707,[0,0,1,0,0],corrcoef>=0.621,[0,0,0,1,0],[0,0,0,0,1])", "name": "v"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "list(vector(rr1)-vector(rr2))", "name": "d"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "0.01", "name": "tol"}, "rr1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "rk(r1)", "name": "rr1"}, "k": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "3", "name": "k"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "tesarr(r1,darr(n,m,[random(1..m)]),9,m)", "name": "r2"}}, "ungrouped_variables": ["tsqovern", "obj", "r1", "r2", "ss", "m", "k", "ssq", "n", "spcoef", "corrcoef", "vs", "spxy", "t", "tol", "v", "sxy", "ssd", "rr2", "rr1", "d"], "statement": "
The data presented in the table below shows the annual promotional expenditure (€000s) and corresponding sales figures (000s units) for eight small businesses.
\nBusiness | \n$\\var{obj[0]}$ | \n$\\var{obj[1]}$ | \n$\\var{obj[2]}$ | \n$\\var{obj[3]}$ | \n$\\var{obj[4]}$ | \n$\\var{obj[5]}$ | \n$\\var{obj[6]}$ | \n$\\var{obj[7]}$ | \n
---|---|---|---|---|---|---|---|---|
Expenditure $(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
Sales $(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
\\[r=\\frac{n\\Sigma xy -\\Sigma x \\Sigma y}{\\sqrt{n\\Sigma x^2-(\\Sigma x)^2}\\sqrt{n\\Sigma y^2-(\\Sigma y)^2}}\\]
", "extensions": ["stats"], "advice": "The answers to all parts are given on revealing.
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"js": "", "css": ""}, "functions": {"pstdev": {"language": "jme", "parameters": [["l", "list"]], "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "type": "number"}, "tesarr": {"language": "jme", "parameters": [["a", "list"], ["b", "list"], ["d", "number"], ["m", "number"]], "definition": "if(marr(map(abs(x),x,list(vector(a)-vector(b))))Expenditure $(X)$ | \n$\\sum x=\\;$[[0]] | \n$\\sum x^2=\\;$[[1]] | \n
---|---|---|
Sales $(Y)$ | \n$\\sum y=\\;$[[2]] | \n$\\sum y^2=\\;$[[3]] | \n
Also find $\\sum xy=\\;$[[4]].
\nHence calculate the correlation coefficient $r$ correct to 3 decimal places:
\n$r=\\;$[[5]]
\n", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "gapfill"}], "name": "Michael's copy of Catherine's copy of Pearson1", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Calculate the Pearson correlation coefficient on paired data and comment on the significance.
\nrebelmaths
"}, "type": "question", "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}]}], "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}