The GAMPL Procedure

Tests for Smoothing Components

The GAMPL procedure performs a smoothing component test on the null hypotheses $f_ j=0$ for the jth component. In contrast to the analysis of deviance that is used in PROC GAM (which tests existence of nonlinearity for each smoothing component), the smoothing component test used in PROC GAMPL tests for the existence of a contribution for each smoothing component.

The hypothesis test is based on the Wald statistic. Define $\bX _ j$ as the matrix of all zeros except for columns that correspond to basis expansions of the jth spline term. Then the column vector of predictions is $\hat{\mb{f}}_ j=\bX _ j\hat{\bbeta }$, and the covariance matrix for the predictions is $\bV _ j=\bX _ j\bV _{\bbeta }\bX _ j’$. The Wald statistic for testing is

\[ T_ r = \hat{\mb{f}}_ j’\bV _ j^{r-}\hat{\mb{f}}_ j = \hat{\bbeta }’\bX _ j’(\bX _ j\bV _{\bbeta }\bX _ j’)^{r-}\bX _ j\hat{\bbeta } \]

where $\bV _ j^{r-}$ is the rank-r pseudo-inverse of $\bV _ j$. If $\bR _ j$ is the Cholesky root for $\bX _ j’\bX _ j$ such that $\bR _ j’\bR =\bX _ j’\bX _ j$, then the test statistic can be written as

\[ T_ r = \hat{\bbeta }’\bR _ j’(\bR _ j\bV _{\bbeta }\bR _ j’)^{r-}\bR _ j\hat{\bbeta } \]

Wood (2012) proposes using the $\mathrm{df}_ j^ t$ degrees of freedom for test (which is defined in the section Degrees of Freedom) as the rank r. Because spline terms in fitted models often have noninteger degrees of freedom, the GAMPL procedure uses a rounded value of $\mathrm{df}_ j^ t$ as the rank:

\begin{equation*} r = \begin{cases} \lfloor \mathrm{df}_ j^ t\rfloor & \text {if }\mathrm{df}_ j^ t-\lfloor \mathrm{df}_ j^ t\rfloor <=0.05\text { or }\mathrm{df}_ j^ t<1 \\ \lceil \mathrm{df}_ j^ t\rceil & \text {otherwise} \end{cases}\end{equation*}

Let K be a symmetric and nonnegative definite matrix, and let its eigenvalues be sorted as $d_1>d_2>\cdots $; then the rank-r pseudo-inverse of K is formed by

\[ K^{r-} = U_ k\begin{bmatrix} d_1^{-1} & & \\ & \ddots & \\ & & d_ r^{-1} \end{bmatrix}U_ k’ \]

where $U_ k$ are formed by columns of eigenvectors that correspond to the r eigenvalues.

Under the null hypothesis, the Wald statistic $T_ r$ approximately follows the chi-square distribution $T_ r\sim \chi _ r^2$. For an observed test statistic $t_ r$, the p-value for rejecting the null hypothesis is computed as $P(\chi ^2_ r>t_ r)$ if the dispersion parameter is constant, or $P(F_{r,\mathrm{df}_ r}>t_ r)$ with $\mathrm{df}_ r$ error degrees of freedom if the dispersion parameter is estimated.

Be cautious when you interpret the results of the smoothing component test because p-values are computed by approximation and the test does not take the smoothing parameter selection process into account.