Learn R Programming

BGGM (version 1.0.0)

plot.metric: Plot metric Objects

Description

Plot metric Objects

Usage

# S3 method for metric
plot(
  x,
  type = "error_bar",
  cred = 0.95,
  alpha = 0.5,
  scale = 1,
  width = 0,
  size = 1,
  color = "blue",
  rope = 0.1,
  ...
)

Arguments

x

object of class metric

type

"error_bar" or "ridgeline"

cred

credible interval

alpha

transparency of tail region (type = "ridgeline")

scale

overlap of densities (type = "ridgeline")

width

width of error bar end (type = "error_bar")

size

point size (type = "error_bar")

color

point (type = "error_bar") or tail region (type = "ridgeline" ) color

rope

region of practical equivalence (only for Bayes R2 difference)

...

currently ignored

Value

ggplot

Examples

Run this code
# NOT RUN {
# data
Y <- subset(tas, gender == "M")[,-ncol(tas)]

# fit model
fit <- estimate(Y)

# posterior predictions
pred <- posterior_predict(fit, iter = 500,
                          summary = FALSE)

# prediction error
error <- mse(pred)

# plot
plot(error)
# }

Run the code above in your browser using DataLab