// Numbas version: finer_feedback_settings {"name": "Derek's copy of Calculate Pearson correlation coefficient", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "
Please print and refer to the coding sheet if you wish.
\nCouple | \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$\\var{obj[8]}$ | \n$\\var{obj[9]}$ | \n
---|---|---|---|---|---|---|---|---|---|---|
Wife $(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$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \n
Husband $(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$\\var{r2[8]}$ | \n$\\var{r2[9]}$ | \n
In this exercise you will find the Pearson correlation coefficent for the above paired data and comment on the significance of the calculated correlation.
\nThe null hypothesis you are testing is:
\n$H_0$: There is no association between the attitudes of wives and husbands.
", "functions": {"pstdev": {"parameters": [["l", "list"]], "type": "number", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "language": "jme"}, "marr": {"parameters": [["a", "list"]], "type": "number", "definition": "if(length(a)=2,max(a[0],a[1]),max(a[0],marr(a[1..length(a)])))", "language": "jme"}, "darr": {"parameters": [["n", "number"], ["m", "number"], ["a", "list"]], "type": "list", "definition": "if(n=1,a,darr(n-1,m,[random(1..m except a)]+a))", "language": "jme"}, "tesarr": {"parameters": [["a", "list"], ["b", "list"], ["d", "number"], ["m", "number"]], "type": "list", "definition": "if(marr(map(abs(x),x,list(vector(a)-vector(b))))Calculate the Pearson correlation coefficient on paired data and comment on the significance.
"}, "parts": [{"customMarkingAlgorithm": "", "showCorrectAnswer": true, "type": "gapfill", "variableReplacements": [], "gaps": [{"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "t[0]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "t[0]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "ssq[0]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "ssq[0]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "t[1]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "t[1]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "ssq[1]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "ssq[1]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "sxy", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "sxy", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "ss[0]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "ss[0]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "ss[1]", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "ss[1]", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "spxy", "scripts": {}, "marks": 0.5, "extendBaseMarkingAlgorithm": true, "maxValue": "spxy", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "corrcoef-tol", "scripts": {}, "marks": 1, "extendBaseMarkingAlgorithm": true, "maxValue": "corrcoef+tol", "unitTests": []}], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showFeedbackIcon": true, "prompt": "\nWife $(X)$ | \n$\\sum x=\\;$[[0]] | \n$\\sum x^2=\\;$[[1]] | \n
---|---|---|
Husband $(Y)$ | \n$\\sum y=\\;$[[2]] | \n$\\sum y^2=\\;$[[3]] | \n
Also find $\\sum xy=\\;$[[4]] and then:
\n$\\displaystyle SSX = \\;$[[5]]
\n$\\displaystyle SSY = \\;$[[6]]
\n$\\displaystyle SPXY = \\;$[[7]]
\nHence calculate the correlation coefficient $r$:
\n$r=\\;$[[8]]
\n\n ", "scripts": {}, "marks": 0, "extendBaseMarkingAlgorithm": true, "unitTests": []}, {"customMarkingAlgorithm": "", "showCorrectAnswer": true, "type": "gapfill", "variableReplacements": [], "gaps": [{"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "0.549", "scripts": {}, "marks": 0.25, "extendBaseMarkingAlgorithm": true, "maxValue": "0.549", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "0.632", "scripts": {}, "marks": 0.25, "extendBaseMarkingAlgorithm": true, "maxValue": "0.632", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "0.765", "scripts": {}, "marks": 0.25, "extendBaseMarkingAlgorithm": true, "maxValue": "0.765", "unitTests": []}, {"customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "0.847", "scripts": {}, "marks": 0.25, "extendBaseMarkingAlgorithm": true, "maxValue": "0.847", "unitTests": []}, {"customMarkingAlgorithm": "", "showCorrectAnswer": true, "type": "1_n_2", "matrix": "v", "maxMarks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}, "marks": 0, "displayColumns": 1, "extendBaseMarkingAlgorithm": true, "shuffleChoices": false, "minMarks": 0, "unitTests": [], "choices": ["$p \\leq 0.002$, very strong evidence to reject the null hypothesis that there is no association.", "$0.002 \\lt p \\leq 0.01$, strong evidence to reject the null hypothesis that there is no association.", "$0.01 \\lt p \\leq 0.05$, there is evidence to reject the null hypothesis that there is no association.", "$0.05 \\lt p \\leq 0.1$, weak evidence against, do not reject the null hypothesis but consider further investigation.", "$p \\gt 0.1$, no evidence to reject the null hypothesis that there is no association."]}], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showFeedbackIcon": true, "prompt": "\n
Give the value of the correlation coefficient you have found, choose the range for the $p$ value by looking up the relevant table. Input the required values from the table here:
\n$10\\%$ | \n$5\\%$ | \n$1\\%$ | \n$0.2\\%$ | \n
[[0]] | \n[[1]] | \n[[2]] | \n[[3]] | \n
Then make a decision based on the $p$-value you have found by choosing one of these options:
\n[[4]]
\n ", "scripts": {}, "marks": 0, "extendBaseMarkingAlgorithm": true, "unitTests": []}], "preamble": {"css": "", "js": ""}, "advice": "The answers to all parts are given on revealing.
", "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Derek Hunt", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2889/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Derek Hunt", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2889/"}]}