The GLM Procedure

Computational Method

Let $\mb {X}$ represent the $n \times p$ design matrix and $\mb {Y}$ the $n \times 1$ vector of dependent variables. (See the section Parameterization of PROC GLM Models for information about how $\mb {X}$ is formed from your model specification.)

The normal equations $\mb {X’X} \bbeta =\mb {X’Y}$ are solved using a modified sweep routine that produces a generalized inverse $(\mb {X’X})^{-}$ and a solution $\mb {b}=(\mb {X’X})^{-}\mb {X’y}$. The modification is that rows and columns corresponding to diagonal elements that are found during sweeping to be zero (or within the expected level of numerical error of zero) are zeroed out. The $(\mb {X’X})^-$ produced by this procedure satisfies the following two equations:

\begin{eqnarray*}  (\mb {X’X})\phantom{^-} (\mb {X’X})^- (\mb {X’X})\phantom{^-} &  = &  (\mb {X’X})\phantom{^-} \\ (\mb {X’X})^- (\mb {X’X})\phantom{^-} (\mb {X’X})^- &  = &  (\mb {X’X})^- \end{eqnarray*}

Pringle and Rayner (1971) call a generalized inverse with these characteristics a $g_2$-inverse, and this is the term usually used in SAS documentation and output. Urquhart (1968) uses the term reflexive g-inverse to emphasize that $(\mb {X’X})^-$ is a generalized inverse of $\mb {X’X}$ in the same way that $\mb {X’X}$ is a generalized inverse of $(\mb {X’X})^-$. Note that a $g_2$-inverse is not necessarily unique: if $\mb {X’X}$ is singular, then sweeping the matrix in a different order will result in a different $g_2$-inverse that also satisfies the two preceding equations.

For each effect in the model, a matrix $\mb {L}$ is computed such that the rows of $\mb {L}$ are estimable. Tests of the hypothesis $\mb {L}\bbeta =0$ are then made by first computing

\[  \mbox{SS}(\mb {L} \bbeta = 0) = (\mb {Lb})’ (\mb {L}(\mb {X’X})^{-}\mb {L}’)^{-1}(\mb {Lb})  \]

and then computing the associated F value by using the mean squared error.