Learn R Programming

psycho (version 0.4.91)

standardize.stanreg: Standardize Posteriors.

Description

Compute standardized posteriors from which to get standardized coefficients.

Usage

# S3 method for stanreg
standardize(x, method = "refit", ...)

Arguments

x

A stanreg model.

method

"refit" (default) will entirely refit the model based on standardized data. Can take a long time. Other post-hoc methods are "posterior" (based on estimated SD) or "sample" (based on the sample SD).

...

Arguments passed to or from other methods.

See Also

https://github.com/stan-dev/rstanarm/issues/298

Examples

Run this code
# NOT RUN {
library(psycho)
library(rstanarm)

fit <- rstanarm::stan_glm(Sepal.Length ~ Sepal.Width * Species, data = iris)
fit <- rstanarm::stan_glm(Sepal.Length ~ Sepal.Width * Species, data = standardize(iris))
posteriors <- standardize(fit)
posteriors <- standardize(fit, method = "posterior")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab