[R] Estimate predictor contribution in GAM models
Simon Wood
sw283 at maths.bath.ac.uk
Fri Sep 30 15:34:13 CEST 2005
On Tue, 20 Sep 2005, Yves Magliulo wrote:
> hi,
>
> i'm using gam() function from package mgcv.
>
> if G is my gam object, then
> >SG=summary(G)
> Formula:
> y ~ +s(x0, k = 5) + s(x1) + s(x2, k = 3)
>
> Parametric coefficients:
> Estimate std. err. t ratio Pr(>|t|)
> (Intercept) 3.462e+07 1.965e+05 176.2 < 2.22e-16
>
> Approximate significance of smooth terms:
> edf chi.sq p-value
> s(x0) 2.858 70.629 1.3129e-07
> s(x1) 8.922 390.39 2.6545e-13
> s(x2) 1.571 141.6 1.8150e-11
>
> R-sq.(adj) = 0.955 Deviance explained = 97%
> GCV score = 2.4081e+12 Scale est. = 1.5441e+12 n = 40
> --------------------------------------
>
> =>
> But how can i estimate numericaly the contribution of each smooth
> against the others. In others words, is there a way to quantify this
> significance like a percentage of how the model is improved by each of
> my predictors?
- The easiest thing to do is probably to refit the model without each
predictor, and look at how much the r^2 drops. You might want to fix the
smoothing parameters when you do this: G$sp gives the original smoothing
parameter estimates for the model with all terms, so you can pick out the
appropriate smoothing parameters to send to `gam' via the `sp' argument,
for the 2 term fits.
best,
Simon
More information about the R-help
mailing list