13.3 Predictions and Comparisons
predict
- produces a single value (the average)
## 1
## 0.5557417
response
here puts the result on the probability scale.
Note: this is the nearly same as the point estimate:
## (Intercept)
## 0.5562355
posterior_linpred
- samples of linear prediction in the logit scale
## [1] 4000
posterior_epred
- samples ofprediction on the probability scale (just invlogit linpred)
## [1] 4000
As usual, the advantage of Bayesian is we can get the mean and standard deviation of the predicted probability:
## [1] 0.55574173 0.02974654
Note that mean(epred)
is exactly what predict
returned (with type = ‘response’)
posterior_predict
- generate random predictions using the posterior probability .
## [1] 4000
## [1] 0 1 1 0 0 0 0 0 1 1
## [1] 0.55575