Skip to content
Prev 332619 / 398506 Next

forecast.lm() and NEWDATA

Hi David (and everyone)

Thank you for your reply.

I see I copied down the code wrong for the regression. I was using the 
"+" seperator, and not ",".  The regression was working.

I made a mistake with the NEWDATA, where I also used "+", instead of 
",", however I see both work but return very different results. I have 
corrected the mistake.

However, I am still receiving the same error when I try to run the 
forecast.lm.
"

forecast.lm(REGGY, h=5)

i receive the following error
"Error in as.data.frame(newdata) :
  argument "newdata" is missing, with no default""



I am sorry to say, I don't understand your reference to the string 
output when you mentioned

"

You should post the output of str() on the data-objects that has the 12 variables and if it was modified the data argument pasted to `lm()` when you made REGGY.

"
  As of right now, NEWDATA includes all the independent variables from 
the REGGY Regression.


Should the NEWDATA data.frame include the dependent variable?

Also, is it necessary to reformat all variables as time series? (I have 
not currently done so)

Regards
Ryan
On 2013-11-01 07:28 PM, David Winsemius wrote: