Skip to content

predict.lm(...,type="terms") question

1 message · David Winsemius

#
On Aug 31, 2012, at 5:27 PM, jjthaden wrote:

            
The code you offered had an extra comma in the 'area' vector. Removing  
allowed the fitting and prediction to proceed without error, I do not  
see why you are producing code from predict.lm.
That statement is also not reproducible. To gain further attention you  
should offer code that demonstrates what errors you are seeing.

x <- rnorm(15); x2=rnorm(15)
  y <- x + x2 +rnorm(15)
  fit <- lm(y ~ x+x2)
  new <- data.frame(x = seq(-3.5, 3.5, 0.5)  )
  predict(fit, newdate=new)
# no error is thrown.

Given the fact that your earlier effort had an obvious syntax error  
that had absolutely nothing to do with predict.lm argument, I would  
ask that you conduct better testing of code that you offer for review.  
You now show no evidence for your assertion about the source of the  
error. Where is the error message and the results of traceback()?  
Where is the data. Where is the code?

(And please include context. (It is not difficult to do so with Nabble.)