plot.summary_fitsae {tipsae} | R Documentation |
Plot Method for a summary_fitsae
Object
Description
The generic method plot()
provides, in a grid (default) or sequence, (a) a scatterplot of direct estimates versus model-based estimates, visually capturing the shrinking process, (b) a Bayesian P-values histogram, (c) a boxplot of standard deviation reduction values, and, if areas sample sizes are provided as input in fit_sae()
, (d) a scatterplot of model residuals versus sample sizes, in order to check for design-consistency i.e., as long as sizes increase residuals should converge to zero.
Usage
## S3 method for class 'summary_fitsae'
plot(
x,
size = 2.5,
alpha = 0.8,
n_bins = 15,
grid = TRUE,
label_names = NULL,
...
)
Arguments
x |
Object of class |
size |
Aesthetic option denoting the size of scatterplots points, see |
alpha |
Aesthetic option denoting the opacity of scatterplots points, see |
n_bins |
Denoting the number of bins used for histogram. |
grid |
Logical indicating whether plots are displayed in a grid ( |
label_names |
Character string indicating the model name to display in boxplot x-axis label. |
... |
Currently unused. |
Value
Four ggplot2
objects in a grid.
See Also
summary.fitsae
to produce the input object.
Examples
library(tipsae)
# loading toy dataset
data("emilia_cs")
# fitting a model
fit_beta <- fit_sae(formula_fixed = hcr ~ x, data = emilia_cs, domains = "id",
type_disp = "var", disp_direct = "vars", domain_size = "n",
# MCMC setting to obtain a fast example. Remove next line for reliable results.
chains = 1, iter = 150, seed = 0)
# check model diagnostics
summ_beta <- summary(fit_beta)
# visualize diagnostics via plot() method
plot(summ_beta)