[R] Predict from glm
Luciano La Sala
lucianolasala at yahoo.com.ar
Wed Mar 24 15:36:09 CET 2010
Dear list members,
I fitted a glm model (See output below). My outcome is death, and weight
(continuous), ClutchSize (3-level factor), EggVolume (continuous), Sex
(obviously 2-level factor), and SiblingCompetence (2-level factor) are my
covariates.
I'd like to obtain the odds of death for a range of Weights, EggVolumes, and
different combinations of ClutchSize. I've tried using the "predict"
function but I just can't seem to get it right. Could anyone give me some
guidance? I am not including codes with predict function in my message
because I got it totally wrong (lots of errors) and I'd rather start from
scratch with some fresh guidance from the list.
Thank you very much. Luciano
Call:
glm(formula = Death ~ Weight + ClutchSize + EggVolume + Sex + SibComp,
family=binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7205 -0.8476 -0.5362 0.9769 2.3132
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 5.90543 2.60526 2.267 0.0234 *
Weight -0.02521 0.01709 -1.475 0.1402
ClutchSizeTwo-eggs 1.61701 0.65699 2.461 0.0138 *
ClutchSizeThree-eggs 1.07775 0.66945 1.610 0.1074
EggVolume -0.08200 0.03375 -2.430 0.0151 *
SexMale 0.77882 0.35374 2.202 0.0277 *
SibCompPresente 0.72333 0.40077 1.805 0.0711 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 238.12 on 182 degrees of freedom
Residual deviance: 200.09 on 176 degrees of freedom
(84 observations deleted due to missingness)
AIC: 214.09
Number of Fisher Scoring iterations: 4
More information about the R-help
mailing list