Fit and predict

Hi, I came across "fit" on this code, I can't figure out what he's doing
What is it used for?

prediction<-predict(M1,newdata=slips65,type="response",se=TRUE)
prediction
$fit
2001 2002 2003 2004 2005 2006 2007 2008
10.92399 19.28838 28.54045 39.36775 56.40017 88.38516 91.55502 134.80454
2009 2010 2011 2012 2013 2014 2015 2016
183.87145 208.38842 251.64970 231.82498 296.56115 447.25808 666.11292 1408.54297

$se.fit
2001 2002 2003 2004 2005 2006 2007 2008
1.559061 1.923999 2.238658 2.526213 2.841135 4.331204 3.172603 4.677866
2009 2010 2011 2012 2013 2014 2015 2016
7.468894 6.704291 8.793129 13.566382 18.870844 26.969052 46.168287 166.951728

$residual.scale
[1] 1

thank you all

this is not a part of code, but rather the first part of the results printed to console from the previous code line that had been run. prediction
i.e. what is the content of the prediction object that was just made by running predict() and assigning it to the prediction name.

yes you right, I did not write it well. I had to add new data to the graph that I predicted,
And in the code I saw that I had the "$ fit" I didn't understand what it represented
prediction<-predict(M1,newdata=slips65,type="response",se=TRUE)
prediction
lines(prediction**$fit**~slips65$year,col="blue")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.