Skip to content
Prev 78041 / 398502 Next

p-level in packages mgcv and gam

Yves Magliulo said the following on 2005-09-28 17:05:
This is not correct. The df are estimated in both cases (i.e. UBRE and 
GCV), but the scale parameter is fixed in the UBRE case. Hence, by 
default UBRE is used for family = binomial or poisson since the scale 
parameter is assumed to be 1. Similarly, GCV is the default for family = 
gaussian since we most often want the scale (usually denoted sigma^2) to 
be estimated.
The warning applies in both cases. The p-values are conditional on the 
smoothing parameters, and the uncertainty of the smooths is not taken 
into account when computing the p-values.
No...
Which version of mgcv do you use? The confusion probably stems from 
earlier versions of mgcv (< 1.3-5): the summary and anova methods used 
to have a column denoted Chi.sq even when the displayed statistic was 
computed as F. Recent versions of mgcv has

 > summary(b)

Family: gaussian
Link function: identity

Formula:
y ~ s(x0) + s(x1) + s(x2) + s(x3)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)
(Intercept)   7.9150     0.1049   75.44   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Approximate significance of smooth terms:
         edf Est.rank      F  p-value
s(x0) 5.173    9.000  3.785 0.000137 ***
s(x1) 2.357    9.000 34.631  < 2e-16 ***
s(x2) 8.517    9.000 84.694  < 2e-16 ***
s(x3) 1.000    1.000  0.444 0.505797
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-sq.(adj) =  0.726   Deviance explained = 73.7%
GCV score =  4.611   Scale est. = 4.4029    n = 400


If we assume that the scale is known and fixed at 4.4029, we get

 > summary(b, dispersion = 4.4029)

Family: gaussian
Link function: identity

Formula:
y ~ s(x0) + s(x1) + s(x2) + s(x3)

Parametric coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept)   7.9150     0.1049   75.44   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Approximate significance of smooth terms:
         edf Est.rank  Chi.sq p-value
s(x0) 5.173    9.000  34.067 8.7e-05 ***
s(x1) 2.357    9.000 311.679 < 2e-16 ***
s(x2) 8.517    9.000 762.255 < 2e-16 ***
s(x3) 1.000    1.000   0.444   0.505
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-sq.(adj) =  0.726   Deviance explained = 73.7%
GCV score =  4.611   Scale est. = 4.4029    n = 400

Note that t/F changed into z/Chi.sq.
The underlying algorithms are very different.


HTH,
Henric