// Numbas version: finer_feedback_settings {"name": "Multiple and partial correlation(old)", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"datax1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "list(vector(datay)+vector(repeat(random(-4,-3,4,5,6),10)))", "description": "", "name": "datax1"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(spyx1/sqrt(ssy*ssx1),2)", "description": "", "name": "r1"}, "spyx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "syx1-t[0]*t[1]/10", "description": "", "name": "spyx1"}, "pcc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((r2-r1*r12)/(sqrt((1-r1^2)*(1-r12^2))),3)", "description": "", "name": "pcc"}, "ssqy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datay)*vector(datay))[0]", "description": "", "name": "ssqy"}, "datax2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "list(vector(datay)+vector(repeat(random(-4,-3,-2,-1,3,4,5),10)))", "description": "", "name": "datax2"}, "ssx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ssqx2-t[2]^2/10", "description": "", "name": "ssx2"}, "sx1x2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datax1)*vector(datax2))[0]", "description": "", "name": "sx1x2"}, "ssy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ssqy-t[0]^2/10", "description": "", "name": "ssy"}, "spyx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "syx2-t[0]*t[2]/10", "description": "", "name": "spyx2"}, "syx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datax1)*vector(datay))[0]", "description": "", "name": "syx1"}, "r12": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(spx1x2/sqrt(ssx2*ssx1),2)", "description": "", "name": "r12"}, "spx1x2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sx1x2-t[1]*t[2]/10", "description": "", "name": "spx1x2"}, "ssqx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datax1)*vector(datax1))[0]", "description": "", "name": "ssqx1"}, "datay": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(random(5..20),10)", "description": "", "name": "datay"}, "r": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r1*r12", "description": "", "name": "r"}, "ssx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ssqx1-t[1]^2/10", "description": "", "name": "ssx1"}, "rsq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((r1^2+r2^2-(2*r1*r2*r12))/(1-r12^2),2)", "description": "", "name": "rsq"}, "syx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datax2)*vector(datay))[0]", "description": "", "name": "syx2"}, "s": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ceil(20*r1*r2/(r1^2+r2^2))", "description": "", "name": "s"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(spyx2/sqrt(ssy*ssx2),2)", "description": "", "name": "r2"}, "ssqx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(matrix(datax2)*vector(datax2))[0]", "description": "", "name": "ssqx2"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(datay),sum(datax1),sum(datax2)]", "description": "", "name": "t"}, "remv": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(100*pcc^2,2)", "description": "", "name": "remv"}}, "ungrouped_variables": ["spx1x2", "ssqx2", "ssqx1", "r12", "sx1x2", "pcc", "syx1", "syx2", "ssy", "spyx2", "spyx1", "ssqy", "datax2", "rsq", "ssx2", "r1", "r2", "ssx1", "datax1", "remv", "s", "r", "datay", "t"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Multiple and partial correlation(old)", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "round(100*r1^2)", "minValue": "round(100*r1^2)", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "round(100*r2^2)", "minValue": "round(100*r2^2)", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "round(100*Rsq)", "minValue": "round(100*Rsq)", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

What proportion of the variability in $Y$ is explained by:

\n

(i) $X_1$ alone? $R^2=\\;$[[0]]%

\n

(ii) $X_2$ alone? $R^2=\\;$[[1]]%

\n

(iii) $X_1$ and $X_2$ together? $R^2=\\;$[[2]]%

\n

All percentages to the nearest whole number.

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

What is the partial correlation coefficient between $Y$ and $X_2$ after fitting $X_1$?

\n

Partial correlation coefficient = [[0]].

\n

Input your answer to 3 decimal places.

\n

How much of the remaining variability in $Y$ is explained by $X_2$ after fitting $X_1$?

\n

Input your answer here as a percentage to 2 decimal places: [[1]]%

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

In a multiple regression example, it is found that:

\n

1. The correlation coefficient of $Y$ with $X_1$ is $\\var{r1}$.

\n

2. The correlation coefficient of $Y$ with $X_2$ is $\\var{r2}$.

\n

3. The correlation coefficent of $X_1$ with $X_2$ is $\\var{r12}$.

\n

Answer the following questions:

", "tags": ["checked2015", "correlation coefficients", "fitting a regression", "multiple correlation", "multiple regression", "partial correlation coefficient", "proportion of variability", "unused", "variability"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

The correlation coefficients are generated by $Y$ a random sample of 10 numbers between 5 and 20, $X_1$ obtained from $Y$ by adding on some noise and similarly for $X_2$. The correlation coefficients are then worked out from these samples.

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

Multiple correlation question. Given the correlation coefficent of $Y$ with $X_1$ is $r_{01}$, the correlation coefficent of $Y$ with $X_2$ is $r_{02}$ and the correlation coefficent of $X_1$ with $X_2$ is $r_{12}$ then explain the proportion of variablity of $Y$. Also find the partial corr coeff between $Y$ and $X_2$ after fitting $X_1$ and find how much of the remaining variability in $Y$ is explained by $X_2$ after fitting $X_1$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}