Learn R Programming

psycho (version 0.1.4)

get_predicted.stanreg: Compute predicted values of stanreg models.

Description

Compute predicted from a stanreg model.

Usage

# S3 method for stanreg
get_predicted(fit, prob = 0.9, draws = 500,
  newdf = FALSE, precision = 10, ...)

Arguments

fit

A stanreg model.

prob

Probability of credible intervals (0.9 (default) will compute 5-95% CI).

draws

Precision of the estimate.

newdf

Should the predictions be based on actual data or, generate a new dataframe based on all combinations of values

precision

Precision of the new dataframe to be generated.

...

Arguments passed to or from other methods.

Value

dataframe with predicted values.

Examples

Run this code
# NOT RUN {
library(psycho)
require(rstanarm)
fit <- rstanarm::stan_glm(vs ~ mpg * cyl, data=mtcars)

predicted <- get_predicted(fit)
# }

Run the code above in your browser using DataLab