aveEffPlot | R Documentation |
For objects of class glm
, it calculates the change the average
predicted probability (like the one calculated by glmChange2
) for a
hypothetical candidate set of values of a covariate.
aveEffPlot(
obj,
varname,
data,
R = 1500,
nvals = 25,
level = 0.95,
ciType = c("percent", "normal"),
return = c("ci", "plot", "sim"),
...
)
obj |
A model object of class |
varname |
Character string giving the variable name for which average effects are to be calculated. |
data |
Data frame used to fit |
R |
Number of simulations to perform. |
nvals |
Number of evaluation points at which the average probability will be calculated. |
level |
Scalar giving the confidence level of the point-wise confidence intervals. |
ciType |
Type of confidence interval to be created. If |
return |
Character string indicating what should be returned. Multiple entries are supported. |
... |
Other arguments to be passed down to |
The function plots the average effect of a model covariate, for objects of
class glm
. The function does not work with poly
unless the
coefficients are provided as arguments to the command in the model (see
example below).
A plot or a data frame
Dave Armstrong
data(france)
p <- poly(france$lrself, 2)
left.mod <- glm(voteleft ~ male + age + retnat +
poly(lrself, 2, coefs=attr(p, "coefs")), data=france, family=binomial)
aveEffPlot(left.mod, "age", data=france, plot=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.