Quantcast
Channel: Active questions tagged lm - Stack Overflow
Viewing all articles
Browse latest Browse all 124

Predict.lm incorrect predictions when using predict with a data frame obtained from model.matrix obtained by using model.matrix [closed]

$
0
0

My lm model returns incorrect predictions when using a data frame created from a matrix. I need to used model.matrix to encode some data.

My Code

I tried to compare to calculating them manually by hand and the coefficients are correct the issue is with the predict function. I can' figure out how to make it work. Any help would be appreciated.


Viewing all articles
Browse latest Browse all 124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>