You are viewing a single comment's thread. Return to all comments →
Python solutionn
from statistics import stdev X = [95, 85, 80, 70, 60] Y = [85, 95, 70, 65, 70] n = 5 sdX = stdev(X) sdY = stdev(Y) meanX = sum(X)/len(X) meanY = sum(Y)/len(Y) PCC = (sum([(x-meanX)*(y-meanY) for x,y in zip(X,Y)]))/((n-1)*sdX*sdY) b = PCC*(sdY/sdX) a = meanY-b*meanX print(round(a+b*80, 3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 8: Least Square Regression Line
You are viewing a single comment's thread. Return to all comments →
Python solutionn