Skip to content
Prev 279953 / 398513 Next

what is the difference between using function predict() and coef() in prediction

On Dec 10, 2011, at 11:48 AM, tony333 wrote:

            
The first "T8" should be..^^ .... "X8"

 > zz = predict(xy.lm,data.frame(X8=T8))
 > ss = coef(xy.lm)[1]+(coef(xy.lm)[2])*T8

 > identical(unname(zz), ss)
[1] TRUE
If you give predict alist or data.fram whose name is different than  
that of the origianl variable ist will be ignored.
David Winsemius, MD
West Hartford, CT