Learn R Programming

emdi (version 2.0.1)

compare_plot: Shows plots for the comparison of estimates

Description

Function compare_plot is a generic function used to produce plots comparing point and existing MSE/CV estimates of direct and model-based estimation for all indicators or a selection of indicators.

Usage

compare_plot(
  model,
  direct,
  indicator = "all",
  MSE = FALSE,
  CV = FALSE,
  label = "orig",
  color = c("blue", "lightblue3"),
  shape = c(16, 16),
  line_type = c("solid", "solid"),
  gg_theme = NULL,
  ...
)

Arguments

model

an object of type "emdi","model", representing point and MSE estimates.

direct

an object of type "emdi","direct", representing point and MSE estimates. If the input argument model is of type "model","ebp", direct is required. If the input argument model is of type "model","fh", the direct component is already included in the input argument model.

indicator

optional character vector that selects which indicators shall be returned. Defaults to "all".

MSE

optional logical. If TRUE, the MSE estimates of the direct and model-based estimates are compared via suitable plots. Defaults to FALSE.

CV

optional logical. If TRUE, the coefficient of variation estimates of the direct and model-based estimates are compared via suitable plots. Defaults to FALSE.

label

argument that enables to customize title and axis labels. There are three options to label the evaluation plots: (i) original labels ("orig"), (ii) axis labels but no title ("no_title"), (iii) neither axis labels nor title ("blank").

color

a vector with two elements determining color schemes in returned plots.

shape

a numeric vector with two elements determining the shape of points in returned plots.

line_type

a character vector with two elements determining the line types in returned plots.

gg_theme

theme list from package ggplot2. For using this argument, package ggplot2 must be loaded via library(ggplot2).

...

further arguments passed to or from other methods.

Value

Plots comparing direct and model-based estimators for each selected indicator obtained by ggplot.

Details

Since all of the comparisons need a direct estimator, the plots are only created for in-sample domains. For the new package version (2.0.1), the order of the input arguments direct and model has been changed. In this version, it is still possible to use the old order because the arguments are swapped internally. From the next package version on, it will no longer be possible.

See Also

emdiObject, direct, ebp, fh