pspline               package:survival               R Documentation

_S_m_o_o_t_h_i_n_g _s_p_l_i_n_e_s _u_s_i_n_g _a _p_s_p_l_i_n_e _b_a_s_i_s

_D_e_s_c_r_i_p_t_i_o_n:

     Specifies a penalised spline basis for the predictor. This is done
     by fitting a comparatively small set of splines and penalising the
     integrated second derivative. 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 basis functions greater than about  2-3 times the
     degrees of freedom.  Eilers and Marx point out that if the basis
     functions are evenly spaced, this leads to significant
     computational simplifications.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       x: predictor.  The function does not apply to factor variables.

      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
          = (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: roughness penalty for the 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: number of splines in the basis 

  degree: degree of splines 

     eps: accuracy for 'df' 

  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.

     ...: optional arguments to the control function

_V_a_l_u_e:

     Object of class 'coxph.penalty' containing the spline basis, with
     the appropriate attributes to be recognized as a penalized term by
     the coxph or survreg functions.

_R_e_f_e_r_e_n_c_e_s:

     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, volume 60, 271-293.

_S_e_e _A_l_s_o:

     'coxph','survreg','ridge', 'frailty'

_E_x_a_m_p_l_e_s:

     lfit6 <- survreg(Surv(time, status)~pspline(age, df=2), cancer)
     plot(cancer$age, predict(lfit6), xlab='Age', ylab="Spline prediction")
     title("Cancer Data")
     fit0 <- coxph(Surv(time, status) ~ ph.ecog + age, cancer)
     fit1 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,3), cancer)
     fit3 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,8), cancer)
     fit0
     fit1
     fit3

