probci | R Documentation |
Calculates predicted probabilities for any combination of x-variable values holding all other variables constant at either typical values (average case approach) or at observed values (average effect approach).
probci(
obj,
data,
.b = NULL,
.vcov = NULL,
changeX = NULL,
numQuantVals = 5,
xvals = NULL,
type = c("aveEff", "aveCase"),
returnProbs = FALSE,
calcPW = FALSE
)
obj |
A model of class |
data |
Data frame used to estimate |
.b |
A vector of coefficients to be passed down to the simulation. If
|
.vcov |
A parameter variance covariance matrix to be passed to the
simulation. If |
changeX |
A vector of strings giving the names of variables for which changes are desired. |
numQuantVals |
For quantitative variables, if no x-values are specified
in |
xvals |
A named list of values used to make the predictions. The names
in the list should correspond with the variable names specified in
|
type |
Type of effect to be generated. |
returnProbs |
Whether or not the vecot/matrix of predicted probabilities should be returned as well. |
calcPW |
Should the pairwise differences be calculated? |
Calculates predicted probabilities for any combination of x-variable values holding all other variables constant at either typical values (average case approach) or at observed values (average effect approach). The function uses a parametric bootstrap to provide generate confidence bounds for predicted probabilities and their differences. The confidence intervals produced are raw percentile interviews (at the 5% level).
An data frame with the following variables:
variables |
The
variables and the values at which they are held constant. For example,
|
pred_prob |
The difference in predicted
probability given the following change in |
lower , upper |
The lower and upper 95% confidence bounds. |
Dave Armstrong
data(france)
left.mod <- glm(voteleft ~ male + age + retnat +
poly(lrself, 2, raw=TRUE), data=france, family=binomial)
out <- probci(left.mod, france, changeX="retnat")
out
out2 <- probci(left.mod, france, changeX="lrself",
xvals = list(lrself = c(1,10)))
out2
out3 <- probci(left.mod, france, changeX=c("lrself", "retnat"),
xvals = list(lrself = c(1,10)))
out3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.