We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Artificial Intelligence
- Probability & Statistics - Foundations
- Day 6: Correlation and Regression Lines #2
- Discussions
Day 6: Correlation and Regression Lines #2
Day 6: Correlation and Regression Lines #2
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
A short program in Python 3. Question was unclear. It says R2 and correlation coefficient but R2 is (Correlation coefficient)^2. Check here: https://www.statisticshowto.com/probability-and-statistics/coefficient-of-determination-r-squared/
The correlation is defined as r=cov(x,y)/sd(x)/sd(y). We also know that for linear regression r^2=R^2. In addition, the slope, m=cov(x,y)/var(x).
Using all the above we get that R^2=m^2var^2(x)/sd^2(x)sd^2(y). Or that 0.4=m^2*4^4/4^2/8^2 and that m=1.26
The given information seems sufficient only to determine the slope magnitude, and not its sign. I got the "correct" answer by assuming a positive slope.
We need slope = Sps/Sss. We know: R^2 = 0.4 = (Sps)/(Sss * Spp).
We also have: Sss = (standard deviation of S)^2 = (4)^2 and Spp = (standard deviation of P)^2 = (8)^2.
We need Sps = (deviation between S and P), which we must solve for.
Solving for Sps from the R^2 equation above gives: Sps = (Sss * Spp) * R^2 = (4^2 * 8^2 * 0.4)
Finally: Slope = Sps/Sss = (4^2 * 8^2 * 0.4)/(4^2) = 1.26. Which is the answer.