R: numeric ‘envir’ arg not of length one in predict()

There are several problems here: The newdata argument of predict() needs a predictor variable. You should thus pass it values for Coupon, instead of Total, which is the response variable in your model. The predictor variable needs to be passed in as a named column in a data frame, so that predict() knows what the … Read more

R: numeric ‘envir’ arg not of length one in predict()

There are several problems here: The newdata argument of predict() needs a predictor variable. You should thus pass it values for Coupon, instead of Total, which is the response variable in your model. The predictor variable needs to be passed in as a named column in a data frame, so that predict() knows what the … Read more