[R] Help with confidence intervals for gam model using mgcv
Anthony Staines
anthony.staines at dcu.ie
Sat Mar 10 23:40:06 CET 2012
Hi,
I would be very grateful for advice on getting confidence
intervals for the ordinary (non smoothed) parameter
estimates from a gam.
Motivation
I am studying hospital outcomes in a large data set. The
outcomes of interest to me are all binary variables. The one
in the example here, Dead30d, is death within 30 days of
admission. Sexf is gender (M or F), Age is age in years at
the start of the admission. The standard glm is a logistic
regression :-
glmDead.AS <- glm(Dead30d~Sexf+Age,
data=HIPE,family=binomial(link="logit"))
The corresponding GAM, with a smooth for age, is :-
gamDead.AS <- gam(Dead30d~Sexf+s(Age),
data=HIPE,family=binomial(link="logit"))
For my work, age is a nuisance. We already know exactly the
effect of age (which has an odd shape). I have no interest
in this parameter, nor in CIs for it. The GAM fits notably
better than the GLM. The substantive interest is in the
effects of the other variables, Sexf, and many more.
For the GLM, the confidence intervals are simple matter of
confint(glmDead.AS). For my discipline CI's are required,
and the profile CI's that confint produces are ideal.
There doesn't seem to be an analogous function for mgcv. The
advice most commonly given is to use predict.gam with
se.fit=TRUE. This does not seem to produce CI's for the
non-smoothed parameters, which is what I need to calculate.
CIs for the smooth, which are the focus of interest in many
other cases are not of interest to me.
Any suggestions? Am I missing something very obvious?
Best wishes,
Anthony Staines
--
Anthony Staines, Professor of Health Systems,
School of Nursing and Human Sciences, DCU, Dublin 9,Ireland.
Tel:- +353 1 700 7807. Mobile:- +353 86 606 9713
http://astaines.eu/
More information about the R-help
mailing list