How can I obtain the values of confidence intervals from gam anf glm objects? Thanks in advance -- David Nogu?s Bravo Functional Ecology and Biodiversity Department Pyrenean Institute of Ecology Spanish Research Council Av. Monta?ana 1005 Zaragoza - CP 50059 976716030 - 976716019 (fax)
On Fri, 16 May 2003, David Nogu?s wrote:> How can I obtain the values of confidence intervals from gam anf glm > objects?Confidence intervals of what? (You do need to be more precise.) For the coefficients of a glm, see profile.glm in MASS. For predictions you can get asymptotic (normal-based) CIs from the predict(se=TRUE) results on link scale and transform. For gams it is a lot trickier, as for example there may be multiple local maxima to the likelihood, and there may be non-interval confidence regions for predictions as a result. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
> How can I obtain the values of confidence intervals from gam anf glm > objects?- Vp in the gam object is the covariance matrix of the posterior distribution of the gam parameters under a certian Bayesian model of smoothing, the mean of this distribution is the parameter estimates (coefficients). In the large sample limit the distribution is normal (exactly so for normal errors and identity link). - predict.gam() can give standard errors for any prediction that you ask it to make (on the scale of the linear predictor these are exact and do not, for example, rely on any approximations like the estimators of the smooths being independent). CI's then obtainable from the large sample normal result. - predict.gam() with the type="lpmatrix" will give you the matrix by which the fitted gam coefficients must be multiplied in order to obtain the vector of required predictions (on the scale of the linear predictor). This can be used to obtain the covariance matrix for the predictions directly from the covariance matrix of the parameters. - Confidence intervals for complicated quantities derived from a fitted gam object can be obtained by simulating parameter sets from the multivariate normal with mean given by the fitted coefficients and covariance matrix Vp and re-computing the derived quantity from each. Simon _____________________________________________________________________> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/ >> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ >>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814