Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTimPoNc0J6wxQBsB2FLBeugwcM+Z0w@mail.gmail.com>
Date: 2011-05-13T16:35:37Z
From: Xu Jun
Subject: effects package for adjusted predictions

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