Learn R Programming

clmstan (version 0.1.1)

plot.clmstan: Plot method for clmstan objects

Description

Produces diagnostic plots using the bayesplot package.

Usage

# S3 method for clmstan
plot(
  x,
  type = c("trace", "dens", "hist", "areas", "intervals", "acf"),
  pars = NULL,
  ...
)

Value

A ggplot object

Arguments

x

A clmstan object

type

Type of plot: "trace" (default), "dens", "hist", "areas", "intervals", or "acf" (autocorrelation).

pars

Character vector of parameter names to plot. If NULL, plots beta, c_transformed (except first), and beta0.

...

Additional arguments passed to bayesplot functions. For "acf" type, you can use lags to control the number of lags.

Examples

Run this code
if (FALSE) {
fit <- clm_stan(rating ~ temp, data = wine)
plot(fit)                    # trace plots
plot(fit, type = "dens")     # density plots
plot(fit, type = "intervals") # credible intervals
plot(fit, type = "acf")      # autocorrelation plots
plot(fit, pars = "beta")     # only beta parameters
}

Run the code above in your browser using DataLab