The TRANSREG Procedure

SPLINE and MSPLINE Transformations

The missing portions of variables subjected to SPLINE or MSPLINE transformations are handled the same way as for OPSCORE, MONOTONE, UNTIE, and LINEAR transformations (see the previous section). The nonmissing partition is handled by first creating a B-spline basis of the specified degree with the specified knots for the nonmissing partition of the initial scaling vector and then regressing the target onto the basis. The optimally scaled vector is a linear combination of the B-spline basis vectors. Ordinary least squares regression coefficients are used. An algorithm for generating the B-spline basis is given in de Boor (1978, pp. 134–135). B-splines are both a computationally accurate and efficient way of constructing a basis for piecewise polynomials; however, they are not the most natural method of describing splines.

Consider an initial scaling vector $x=(1~ 2~ 3~ 4~ 5~ 6~ 7~ 8~ 9)^{\prime }$ and a degree-three spline with interior knots at 3.5 and 6.5. The B-spline basis for the transformation is the left matrix, and the natural piecewise polynomial spline basis is the right matrix.

\[  \begin{array}{cc} \mbox{B-Spline Basis} &  \mbox{Piecewise Polynomial Splines} \\[0.05in] \left[ \begin{array}{llllll} 1.000& 0.000& 0.000& 0.000& 0 & 0 \\ 0.216& 0.608& 0.167& 0.009& 0 & 0 \\ 0.008& 0.458& 0.461& 0.073& 0 & 0 \\ 0 & 0.172& 0.585& 0.241& 0.001& 0 \\ 0 & 0.037& 0.463& 0.463& 0.037& 0 \\ 0 & 0.001& 0.241& 0.585& 0.172& 0 \\ 0 & 0 & 0.073& 0.461& 0.458& 0.008\\ 0 & 0 & 0.009& 0.167& 0.608& 0.216\\ 0 & 0 & 0.000& 0.000& 0.000& 1.000\\ \end{array} \right] &  \left[ \begin{array}{rrrrrr} 1& 1&  1&  1&  0 &  0 \\ 1& 2&  4&  8&  0 &  0 \\ 1& 3&  9&  27&  0 &  0 \\ 1& 4& 16&  64&  0.125&  0 \\ 1& 5& 25& 125&  3.375&  0 \\ 1& 6& 36& 216&  15.625&  0 \\ 1& 7& 49& 343&  42.875&  0.125\\ 1& 8& 64& 512&  91.125&  3.375\\ 1& 9& 81& 729& 166.375& 15.625\\ \end{array} \right] \\ \end{array}  \]

The two matrices span the same column space. The natural basis has an intercept, a linear term, a quadratic term, a cubic term, and two more terms since there are two interior knots. These terms are generated (for knot k and $\mb {x}$ element x) by the formula $(x - k)^3 \times I_{(x>k)}$. The indicator variable $I_{(x>k)}$ evaluates to 1.0 if x is greater than k and to 0.0 otherwise. If knot k had been repeated, there would be a $(x - k)^2 \times I_{(x>k)}$ term also. Notice that the fifth column makes no contribution to the curve before 3.5, makes zero contribution at 3.5 (the transformation is continuous), and makes an increasing contribution beyond 3.5. The same pattern of results holds for the last term with knot 6.5. The coefficient of the fifth column represents the change in the cubic portion of the curve after 3.5. The coefficient of the sixth column represents the change in the cubic portion of the curve after 6.5.

The numbers in the B-spline basis do not have a simple interpretation like the numbers in the natural piecewise polynomial basis. The B-spline basis has a diagonally banded structure. The band shifts one column to the right after every knot. The number of entries in each row that can potentially be nonzero is one greater than the degree. The elements within a row always sum to one. The B-spline basis is accurate because of the smallness of the numbers and the lack of extreme collinearity inherent in the natural polynomials. B-splines are efficient because PROC TRANSREG can take advantage of the sparseness of the B-spline basis when it accumulates crossproducts. The number of required multiplications and additions to accumulate the crossproduct matrix does not increase with the number of knots but does increase with the degree of the spline, so it is much more computationally efficient to increase the number of knots than to increase the degree of the polynomial.

MSPLINE transformations are handled like SPLINE transformations except that constraints are placed on the coefficients to ensure monotonicity. When the coefficients of the B-spline basis are monotonically increasing, the transformation is monotonically increasing. When the polynomial degree is two or less, monotone coefficient splines, integrated splines (Winsberg and Ramsay, 1980), and the general class of all monotone splines are equivalent.