plot-method: Plot estimates and diagnostic statistics

Description Usage Arguments Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
dgirt_plot(x, ...)

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

## S4 method for signature '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 signature 'dgo_fit,missing'
plot(x, y, ...)

plot_rhats(x, ...)

## S4 method for signature '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## 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")

## End(Not run)
## 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")

## End(Not run)
## Not run: 
data(toy_dgirtfit)
plot(toy_dgirtfit)

## End(Not run)
## Not run: 
data(toy_dgirtfit)
plot_rhats(toy_dgirtfit)
plot_rhats(toy_dgirtfit, facet_vars = "race3") +
  scale_x_continuous(breaks = seq.int(2006, 2008))

## End(Not run)

jamesdunham/dgirt documentation built on May 18, 2019, 11:19 a.m.