Description Usage Arguments Details Value Author(s) Examples
Generates plots of the relationship between input variables and the expected
value of the outcome, using predVals
as a backend.
1 2 3 4 
x 
a fitted model of class 
which 
selection of variables to plot: a character vector containing
one or two names of raw input variables (see 
ask 
logical: whether to display an interactive menu of terms to select. 
auto.set.par 
logical: whether to temporarily change the graphics
parameters so that multiple plots are displayed in one window (e.g., each
univariate plot when 
interval 
logical: whether to display bootstrap confidence intervals
around each fitted value. Not available for bivariate plots unless

level 
confidence level for the intervals. 
FUN3D 
which plotting function to use to generate bivariate plots.
Valid options include 
control.plot 
list of arguments to be passed to the underlying plotting functions (e.g., axis labels and limits). 
... 
additional arguments to be passed to 
By default, a univariate plot generated by plot.polywog
shows the
relationship between the selected input variable and the expected outcome
while holding all other covariates at "central" values (as in
predVals
). The values that the other variables are held out
can be changed by supplying additional arguments to ...
, as in the
examples below.
Similarly, a bivariate plot shows the relationship between two input variables and the expected outcome while holding all else fixed. If either variable is binary or categorical, the plot will show the relationship between one variable and the expected outcome across each value/level of the other.
An object of class preplot.polywog
, invisibly. This is a
data frame generated by predVals
that contains all information
used in plotting.
Brenton Kenkel and Curtis S. Signorino
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 31 32 33 34 35 36 37 38 39  ## Using occupational prestige data
data(Prestige, package = "carData")
Prestige < transform(Prestige, income = income / 1000)
## Fit a polywog model with bootstrap iterations
## (note: using low convergence threshold to shorten computation time of the
## example, *not* recommended in practice!)
set.seed(22)
fit1 < polywog(prestige ~ education + income + type,
data = Prestige,
degree = 2,
boot = 5,
thresh = 1e4)
## All univariate relationships
plot(fit1, n = 20)
## Predicted prestige across occupational categories
plot(fit1, which = "type",
control.plot = list(xlab = "occupational category"))
## Predicted prestige by education across occupational categories
plot(fit1, which = c("education", "type"), n = 20)
## Joint effect of education and income
plot(fit1, which = c("education", "income"), n = 10)
## Bring up interactive menu
## Not run:
plot(fit1, ask = TRUE)
# displays menu:
# Select one or two variable numbers (separated by spaces), or 0 to exit:
# 1: education
# 2: income
# 3: type
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.