Learn R Programming

edstan (version 1.1.0)

stan_columns_plot: View a plot of summary statistics after using irt_stan

Description

This function creates a figure summarizing parameter-level diagnostics such as R hat and effective sample size.

Usage

stan_columns_plot(fit, stat = "Rhat", ...)

Value

A ggplot object.

Arguments

fit

A stanfit-class object created by irt_stan or stan.

stat

A string for the statistic from the summary method for a stanfit object to plot. The default is "Rhat" but could also be "n_eff" for the effective sample size.

...

Additional options (such as pars), passed to the summary method for a stanfit object. Not required.

See Also

See stan_rhat, which provides a histogram of Rhat statistics.

Examples

Run this code
# Make a suitable data list:
spelling_list <- irt_data(response_matrix = spelling[, 2:5],
                          covariates = spelling[, "male", drop = FALSE],
                          formula = ~ 1 + rescale_binary(male))

if (FALSE) {
# Fit a latent regression  2PL
twopl_fit <- irt_stan(spelling_list, model = "2pl_latent_reg.stan",
                      iter = 2000, chains = 4)

# Get a plot showing Rhat statistics
rhat_columns(twopl_fit)

# Get a plot showing number of effective draws
rhat_columns(twopl_fit, stat = "n_eff")
}

Run the code above in your browser using DataLab