Reputation: 705
I have the resulting regression coefficients in R from a training data set. I now want to use those and apply them to another data set to predict values, however some of the X/independent variables have N/A or missing values which is causing the prediction value to be N/A as well. What commands can I use so that the predict() command will still predict a value for that row even if some of the dependent variable information is missing?
Upvotes: 0
Views: 1753
Reputation: 1166
You need to treat the missing values. Depending on what kind of data you are dealing with, you may impute the missing values accordingly. E.g. - If the column has data type of int, you could try to replace them with a Mean or Median value. If you could be more specific about the data you're dealing with, it will provide more clarity.
Upvotes: 2