Description Usage Arguments Details Value Author(s) Examples
Plots predicted probabilities and associated confidence bands, using the
data returned from a call to predProbs
.
1 2 |
x |
an object of class |
which |
optional integer specifying which plot (as numbered in the menu
displayed when |
ask |
logical: display interactive menu with options for which plot to make? |
... |
further arguments to pass to the plotting function. See
|
Most 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 egame12
or egame122
model
respectively; for an ultimatum
model, these are the expected
offer and the probability of acceptance. By default, plot.predProbs
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.
Brenton Kenkel (brenton.kenkel@gmail.com)
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 28 29 30 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.