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.
(Delta is easy to calculate from the y = f(x) = ax + b form of both regression lines, as a = tan(alpha) where alpha is the angle of the function w.r.t. the x axis)
Personal pitfalls: forgetting to get the square root, forgetting to consider the sign (+ or -) of the result.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Correlation and Regression Lines #1
You are viewing a single comment's thread. Return to all comments →
I found Wikipedia's "geometric interpretation" to be helpful here, i.e.
r² = 1/cos(delta) - tan(delta)
wheredelta
is the angle between the given regression lines. https://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient#Geometric_interpretation(Delta is easy to calculate from the
y = f(x) = ax + b
form of both regression lines, asa = tan(alpha)
where alpha is the angle of the function w.r.t. the x axis)Personal pitfalls: forgetting to get the square root, forgetting to consider the sign (+ or -) of the result.