// Numbas version: exam_results_page_options {"name": "CorrelationInference-Couples", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "CorrelationInference-Couples", "tags": [], "metadata": {"description": "

Calculate the Pearson correlation coefficient and conduct a hypothesis test.

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

It is well known that similarity in attitudes, beliefs and interests plays an important role in interpersonal attraction. A researcher developed a questionnaire which was completed by 8 married couples. One question sought to place each individual on a 20 point scale in which low scores represent liberal attitudes and high scores represent conservative attitudes. The data were:

\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\n\n
CoupleWife $(x)$Husband $(y)$
{obj[0]}{r1[0]}{r2[0]}
{obj[1]}{r1[1]}{r2[1]}
{obj[2]}{r1[2]}{r2[2]}
{obj[3]}{r1[3]}{r2[3]}
{obj[4]}{r1[4]}{r2[4]}
{obj[5]}{r1[5]}{r2[5]}
{obj[6]}{r1[6]}{r2[6]}
{obj[7]}{r1[7]}{r2[7]}
\n
\n

Null hypothesis $H_0$: There is no association between the attitudes of wives and husbands.

\n
\n

Use statistics software to answer the following questions.

", "advice": "

Conduct a regression analysys using statistics software - e.g., in Minitab, use Stat | Regression | Fitted Line Plot.

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "extensions": ["stats"], "variables": {"rr1": {"name": "rr1", "group": "Ungrouped variables", "definition": "rk(r1)", "description": "", "templateType": "anything"}, "tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.05", "description": "", "templateType": "anything"}, "r1": {"name": "r1", "group": "Ungrouped variables", "definition": "darr(n,m,[random(1..20)])", "description": "", "templateType": "anything"}, "spxy": {"name": "spxy", "group": "Ungrouped variables", "definition": "sxy-t[0]*t[1]/n", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "list(vector(rr1)-vector(rr2))", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "20", "description": "", "templateType": "anything"}, "ssq": {"name": "ssq", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "description": "", "templateType": "anything"}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "[sum(r1),sum(r2)]", "description": "", "templateType": "anything"}, "vs": {"name": "vs", "group": "Ungrouped variables", "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])", "description": "", "templateType": "anything"}, "rr2": {"name": "rr2", "group": "Ungrouped variables", "definition": "rk(r2)", "description": "", "templateType": "anything"}, "spcoef": {"name": "spcoef", "group": "Ungrouped variables", "definition": "precround(6*ssd/(n*(n^2-1)),3)", "description": "", "templateType": "anything"}, "ss": {"name": "ss", "group": "Ungrouped variables", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "description": "", "templateType": "anything"}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "switch(corrcoef >=0.905,[4,0,0,0,0],corrcoef>=0.834,[0,4,0,0,0],corrcoef>=0.707,[0,0,4,0,0],corrcoef>=0.621,[0,0,0,4,0],[0,0,0,0,4])", "description": "", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "8", "description": "", "templateType": "anything"}, "obj": {"name": "obj", "group": "Ungrouped variables", "definition": "['A','B','C','D','E','F','G','H']", "description": "", "templateType": "anything"}, "ssd": {"name": "ssd", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,d))", "description": "", "templateType": "anything"}, "sxy": {"name": "sxy", "group": "Ungrouped variables", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "description": "", "templateType": "anything"}, "r2": {"name": "r2", "group": "Ungrouped variables", "definition": "tesarr(r1,darr(n,m,[random(1..m)]),9,m)", "description": "", "templateType": "anything"}, "tsqovern": {"name": "tsqovern", "group": "Ungrouped variables", "definition": "[t[0]^2/n,t[1]^2/n]", "description": "", "templateType": "anything"}, "corrcoef": {"name": "corrcoef", "group": "Ungrouped variables", "definition": "spxy/sqrt(ss[0]*ss[1])", "description": "", "templateType": "anything"}, "b0": {"name": "b0", "group": "Ungrouped variables", "definition": "siground(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "description": "", "templateType": "anything"}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "siground(spxy/ss[0],3)", "description": "", "templateType": "anything"}, "rSquared": {"name": "rSquared", "group": "Ungrouped variables", "definition": "siground(corrcoef^2,3)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["tsqovern", "obj", "r1", "r2", "ss", "m", "k", "ssq", "ssd", "n", "spcoef", "corrcoef", "vs", "spxy", "t", "tol", "v", "sxy", "rr2", "rr1", "d", "b0", "b1", "rSquared"], "variable_groups": [], "functions": {"darr": {"parameters": [["n", "number"], ["m", "number"], ["a", "list"]], "type": "list", "language": "jme", "definition": "if(n=1,a,darr(n-1,m,[random(1..m except a)]+a))"}, "tesarr": {"parameters": [["a", "list"], ["b", "list"], ["d", "number"], ["m", "number"]], "type": "list", "language": "jme", "definition": "if(marr(map(abs(x),x,list(vector(a)-vector(b))))a[i]){s+=1;}\n else\n if(a[j]==a[i]){c+=1;}\n }\n out[j]=(2*s+c+1)/2;\n }\n return out;"}, "marr": {"parameters": [["a", "list"]], "type": "number", "language": "jme", "definition": "if(length(a)=2,max(a[0],a[1]),max(a[0],marr(a[1..length(a)])))"}}, "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": "

What are the parameters of the regression model $y = b_0 + b_1 \\times x$?

\n

$b_0=\\;$[[0]]

\n

$b_1=\\;$[[1]]

", "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": "b0*(1-tol)", "maxValue": "b0*(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": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "b1*(1-tol)", "maxValue": "b1*(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, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the correlation coefficient $R$, both as a decimal and as a percentage?

\n

$R=\\;$[[0]] $=\\;$[[1]]$\\%$

\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.5", "exploreObjective": null, "minValue": "corrcoef*(1-tol)", "maxValue": "corrcoef*(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": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0.5", "exploreObjective": null, "minValue": "100*corrcoef*(1-tol)", "maxValue": "100*corrcoef*(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, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the R-squared coefficient, both as a decimal and as a percentage?

\n

$R^2=\\;$[[0]] $=\\;$[[1]]$\\%$

\n

 

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "corrcoef", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0.5", "exploreObjective": null, "minValue": "rSquared*(1-tol)", "maxValue": "rSquared*(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": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "corrcoef", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0.5", "exploreObjective": null, "minValue": "100*rSquared*(1-tol)", "maxValue": "100*rSquared*(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, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Make a decision by choosing one of these options:

\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": 1, "showCellAnswerState": true, "choices": ["$p \\leq 0.002$, very strong evidence against $H_0$.", "$0.002 \\lt p \\leq 0.01$, strong evidence against $H_0$.", "$0.01 \\lt p \\leq 0.05$, some evidence against $H_0$.", "$0.05 \\lt p \\leq 0.1$, weak evidence against $H_0$ (do not reject $H_0$ but consider further investigation).", "$p \\gt 0.1$, no evidence against $H_0$."], "matrix": "v"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}