You are viewing a single comment's thread. Return to all comments →
no idea why not work pythonic
import numpy as np P = np.array([15, 12, 8, 8, 7, 7, 7, 6, 5, 3]) H = np.array([10, 25, 17, 11, 13, 17, 20, 13, 9, 15]) fit = np.polyfit(P, H, deg=1) a = fit[0] b = fit[1] pred = a * 10 + b print(round(pred, 1))
R
x <- c(15, 12, 8, 8, 7, 7, 7, 6, 5, 3) y <- c(10, 25, 17, 11, 13, 17, 20, 13, 9, 15) linearMod <- lm(y ~ x) pred <- as.vector(linearMod$coefficients)[1] + as.vector(linearMod$coefficients)[2]*10 round(pred,1)
Seems like cookies are disabled on this browser, please enable them to open this website
Correlation and Regression Lines - A quick recap #3
You are viewing a single comment's thread. Return to all comments →
no idea why not work pythonic
R