Last answered:

27 Mar 2020

Posted on:

27 Mar 2020

0

plotting the regression line itself

you didn't explain explicitly how you derive yhat figure that came after x1 or should i say i dont understand how we got those number   
Start your code here
plt.scatter(x1,y)
yhat = x1*223.1787+101900
fig = plt.plot(x1,yhat, lw=4, c='orange', label ='regression line')
1 answers ( 0 marked as helpful)
Instructor
Posted on:

27 Mar 2020

0
Hi Oberewu,  thanks for reaching out! In answer to your question here is the formula for yhat: yhat = x1.b1 + b0 b0 and b1 are the coefficients we obtain from the model fit. b1 is the coefficient for size, whereas b0 is the intercept. You can find the values in the results table, under coef.   Best,  Eli

Submit an answer