Plot predicted probabilities
Plots predicted probabilities and associated confidence bands, using the
data returned from a call to
"plot"(x, which = NULL, ask = FALSE, ...)
- an object of class
predProbs(i.e., a data frame returned by
- optional integer specifying which plot (as numbered in the menu
ask == TRUE) to make. If none is given, all available plots are printed in succession.
- logical: display interactive menu with options for which plot to make?
- further arguments to pass to the plotting function. See
plot.default(when the variable on the x-axis is continuous) or
bxp(when it is discrete).
predProbs objects will be associated with multiple plots: one for
each outcome in the estimated model. These are the three or four terminal
nodes for a
respectively; for an
ultimatum model, these are the expected
offer and the probability of acceptance. By default,
produces plots for all of them, so only the last will be visible unless the
graphics device is set to have multiple figures (e.g., by setting
par(mfrow = ...)). The argument
ask displays a menu to select
among the possible plots for a given object, and
which allows for
this to be done non-interactively.
an object of class
preplot.predProbs, invisibly. This contains the raw information used by lower-level plotting functions.
data("war1800") f1 <- esc + war ~ s_wt_re1 + revis1 | 0 | regime1 | balanc + regime2 m1 <- egame12(f1, data = war1800, boot = 10) pp1 <- predProbs(m1, x = "balanc", n = 5) pp2 <- predProbs(m1, x = "regime1") ## if "ask" is FALSE and "which" isn't specified, all plots are printed op <- par(mfrow = c(2, 2)) plot(pp1) par(op) ## Not run: # plot(pp1, ask = TRUE) # # ## Make a plot selection (or 0 to exit): # ## 1: plot: Pr(~esc) # ## 2: plot: Pr(esc,~war) # ## 3: plot: Pr(esc,war) # ## 4: plot all terms # ## End(Not run) ## To change line type for confidence bounds, use argument `lty.ci` plot(pp1, which = 3, lty.ci = 3) ## All the standard plotting options work too plot(pp1, which = 3, xlab = "Capabilities", ylab = "Probability", main = "Title") ## Discrete `x` variables are plotted via R's boxplot functionality plot(pp2, which = 3)