[R] effects package for adjusted predictions

Xu Jun junxu.r at gmail.com
Fri May 13 18:35:37 CEST 2011


Dear R experts,

I am trying to use John Fox's effects package to conduct some
post-estimation analysis.  I think it is a great package for graphing
predictions after GLM type models.  However, I am having problems
figuring out how to produce an adjusted mean.  For example, using the
following two lines, I can get predictions when phd varies from 1 to
5, female set to 0 and enrol set to its mean, and then use the plot to
get predicted probability plot.

logitmod <- glm(hijob~female+enrol+phd, data=mydta,
family=binomial(lin="logit"))

plot(effect("phd", logitmod, xlevels=list(phd=1:5), given.values=c(female=0)))

But I couldn't figure out how to get just one predicted probability
with a given set of values for independent variables (for example,
female=1, phd=3 and enrol = 7), and it appears that using the effect
command, I have to get multiple predictions?  Thanks a lot!

Jun Xu, PhD
Assistant Professor
Department of Sociology
Ball State University
Muncie, IN 47306



More information about the R-help mailing list