plot_Ic_Simulation: Line or boxplot of an observed and its simulated scores

plot_Ic_SimulationR Documentation

Line or boxplot of an observed and its simulated scores

Description

Generate a line (or box) plot of Ic score and simulated Ic scores, with three horizontal lines: the min, max and 2*(max-min) value of the state of interests, or all values.

Usage

plot_Ic_Simulation(
  Ic,
  simulation,
  las = 0,
  ylim = NULL,
  order = NULL,
  main = NULL,
  ylab = "Ic",
  fun = c("matplot", "boxplot"),
  which2point = NULL
)

Arguments

Ic

A vector with names of states. If order is not assigned, then plot by the order of this vector.

simulation

A numeric matrix of Ic scores in which rows are states and columns are numbers of simulated times. It can be obtained from simulation_Ic

las

Numeric in 0, 1, 2, 3; the style of axis labels. Default is 0, meaning labels are parallel. (link to http://127.0.0.1:21580/library/graphics/html/par.html).

ylim

An integer vector of length 2. Default is NULL.

order

Characters of names of Ic to be plotted in a desired order. Default is NULL.

main

A character vector. The title of the plot. Default is NULL.

ylab

titles y axes, as in plot.

fun

A character choose between ('matplot', 'boxplot'), indicating plot type.

which2point

A character (or integer) which state's values were used to set up the three horizontal lines. by default is NULL, indicating the values of all states will be used.

Value

Return a plot of the observed Ic (red) and simulated Ic (grey) scores per states.

Author(s)

Zhezhen Wang zhezhen@uchicago.edu; Xinan H Yang xyang2@uchicago.edu

Examples

sim = matrix(sample(1:10, 9), 3, 3)
row.names(sim) = paste0('state', 1:3)
Ic = c('state1' = 3.4, 'state2' = 5.6, 'state3' = 2)
plot_Ic_Simulation(Ic, sim)

xyang2uchicago/NPS documentation built on June 30, 2024, 10:15 p.m.