merliseclyde / BAS

BAS R package https://merliseclyde.github.io/BAS/
https://merliseclyde.github.io/BAS/
GNU General Public License v3.0
41 stars 16 forks source link

NAs must be omitted for predict function to work #10

Closed wengers11 closed 6 years ago

wengers11 commented 6 years ago

When building a BMA regression model and using the predict function (i.e. predict.bas) there can be no NAs or NULLs in new data set for prediction. If there are NAs, prediction returns numeric(0) attr(,"best") integer(0)

Currently, recommend using complete.cases() to remove any NAs before prediction.

Hopefully, function can be made more robust by either calculating values for all partially NA rows or excluding NAs entirely with a warning issued.

merliseclyde commented 6 years ago

Fixed in version 1.5.0 (on Github now). Allows user to specify na.action as an argument. Default is na.pass for now, which will return NA's for any rows that have NA's in the columns of the selected models.