mod <- lm(prestige ~ type*(education + income) + women, Prestige)
plot(predictorEffect("income", mod))
plot(predictorEffects(mod, ~ education + income + women))
mod.cowles <- glm(volunteer ~ sex + neuroticism*extraversion, data=Cowles, family=binomial)
plot(predictorEffects(mod.cowles, xlevels=4))
plot(predictorEffect("neuroticism", mod.cowles, xlevels=list(extraversion=seq(5, 20, by=5))),
axes=list(grid=TRUE,
x=list(rug=FALSE),
y=list(lab="Probability of Vounteering")),
lines=list(multiline=TRUE),
type="response")
predictorEffects(mod.cowles, focal.levels=4, xlevels=4)
# svyglm() example (adapting an example from the survey package)
# \donttest{
if (require(survey)){
data(api)
dstrat<-svydesign(id=~1, strata=~stype, weights=~pw,
data=apistrat, fpc=~fpc)
mod <- svyglm(sch.wide ~ ell + meals + mobility, design=dstrat,
family=quasibinomial())
plot(predictorEffects(mod),
axes=list(y=list(lim=log(c(0.4, 0.99)/c(0.6, 0.01)),
ticks=list(at=c(0.4, 0.75, 0.9, 0.95, 0.99)))))
}
# }
Run the code above in your browser using DataLab