Fit a Smoothing Spline

DESCRIPTION:

This is a modeling term for the survival functions coxph and survReg. It fits a smoothing spline using the p-spline basis.

USAGE:

pspline(x, df=4, theta, nterm=2.5 * df, degree=3, eps=0.1, method, ...)

REQUIRED ARGUMENTS:

x
the variable to be fit. The function does not apply to factor variables.

OPTIONAL ARGUMENTS:

df
the desired degrees of freedom. One of the arguments df or theta must be given, but not both. If df=0, then the AIC for the term (loglik -df) is used to choose an "optimal" degrees of freedom. If AIC is chosen, then an optional argument caic=T can be used to specify the corrected AIC of Hurvich et. al.
theta
the tuning parameter in the penalized fit. It is a monotone function of the degrees of freedom, with theta=1 corresponding to a linear fit and theta=0 to an unconstrained fit of nterm degrees of freedom.
nterm
the number of basis functions. Traditional smoothing splines use one basis per observation, but several authors have pointed out that the final results of the fit are indistinguishable for any number of bases greater than about 2-3 times the degrees of freedom.
degree
the degree of the spline, with cubic splines as the default.
eps
tolerance for convergence. The default states that if 4 degrees of freedom is requested, then a solution of 3.9 is close enough.
method
the method for choosing the tuning parameter theta. If theta is given, then "fixed" is assumed. If the degrees of freedom is given, then "df" is assumed. If method="aic", then the degrees of freedom is chosen automatically using Akaike's information criterion.
...
other arguments to the control function.

VALUE:

a matrix of basis functions, with the appropriate attributes to be recognized as a penalized term by the coxph or survReg functions.

REFERENCES:

Eilers, Paul H. and Marx, Brian D. (1996). Flexible smoothing with B-splines and penalties. Statistical Science, 11, 89-121.

Hurvich, C. M. and Simonoff, J. S. and Tsai, Chih-Ling (1998). Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion. JRSSB, 60, 271-293.

SEE ALSO:

, , ,

EXAMPLES:

# No evidence for a non-linear age effect:
coxph(Surv(time, status) ~ pspline(age) + sex + strata(inst),
       data=lung, na.action=na.exclude)