dgirt_plot plots estimates from a dgo model. plot_rhats plots split R-hats.

dgirt_plot(x, ...)

# S4 method for dgo_fit
dgirt_plot(x, y_fun = "median", y_min = "q_025",
  y_max = "q_975", pars = "theta_bar")

# S4 method for data.frame
dgirt_plot(x, group_name, time_name, geo_name,
  y_fun = "median", y_min = "q_025", y_max = "q_975")

# S4 method for dgo_fit,missing
plot(x, y, ...)

plot_rhats(x, ...)

# S4 method for dgo_fit
plot_rhats(x, pars = "theta_bar", facet_vars = NULL,
  shape_var = NULL, color_var = NULL, x_var = NULL)

Arguments

x

A dgo_fit-class object.

...

Further arguments to dgirt_plot.

y_fun

Summary function to be plotted as y.

y_min

Summary function giving the ymin argument for a geom_pointrange object.

y_max

Summary function giving the ymax argument for a geom_pointrange object.

pars

Selected parameter.

group_name

A discrete grouping variable that will be passed to the color argument of aes.

time_name

A time variable with numeric values that will be plotted on the x axis.

geo_name

A variable representing local areas that will be used in faceting.

y

Ignored.

facet_vars

Optionally, one or more variables passed to facet_wrap

shape_var, color_var, x_var

Optionally, a variable passed to the shape, color, or x arguments of aes_string, respectively.

Examples

# NOT RUN {
data(toy_dgirtfit)
dgirt_plot(toy_dgirtfit)
dgirt_plot(toy_dgirtfit, y_min = NULL, y_max = NULL)
p <- dgirt_plot(toy_dgirtfit)
p %+% ylab("posterior median")
# }# NOT RUN {
data(toy_dgirtfit)
ps <- poststratify(toy_dgirtfit, annual_state_race_targets, strata_names =
                   c("state", "year"), aggregated_names = "race3")
dgirt_plot(ps, group_name = NULL, time_name = "year", geo_name = "state")
# }# NOT RUN {
data(toy_dgirtfit)
plot(toy_dgirtfit)
# }# NOT RUN {
data(toy_dgirtfit)
plot_rhats(toy_dgirtfit)
plot_rhats(toy_dgirtfit, facet_vars = "race3") +
  scale_x_continuous(breaks = seq.int(2006, 2008))
# }