On examining non-linearity of Cox coefficients with penalized splines - I have not been able to dig up a completely clear description of the test performed in R or S-plus.>From the Therneau and Grambsch book (2000 - page 126) I gather that the testreported for "linear" has as its null hypothesis that the spline coefficient is the same at the center of basis. Thus, in the example quoted below (from the thread) one might say treating age as linear is not too bad, to the extent that failure to reject a null can be so interpreted. Is that right? And what is the null for the nonlinear test? --Michael Margolis ..............QUOTE.............. Use pspline within a Cox model. It includes a fairly general test for nonlinearity, that is similar to GAM models. Terry Therneau> coxph(Surv(time, status) ~ ph.ecog + pspline(age), lung)Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.4505 0.11766 0.11723 14.66 1.00 0.00013 pspline(age), linear 0.0112 0.00927 0.00927 1.45 1.00 0.23000 pspline(age), nonlin 2.96 3.08 0.41000 Iterations: 4 outer, 10 Newton-Raphson Theta= 0.797 Degrees of freedom for terms= 1.0 4.1 Likelihood ratio test=22.7 on 5.07 df, p=0.000412 n=227 (1 observation deleted due to missingness)
> On examining non-linearity of Cox coefficients with penalized splines - I > have not been able to dig up a completely clear description of the test > performed in R or S-plus.One "iron clad" way to test is to fit a model that has the variable of interest "x" as a linear term, then a second model with splines, and do a likelihood ratio test with 2*(difference in log-likelihood) on (difference in df) degrees of freedom. With a penalized model this test is conservative: the chi-square is not quite the right distribution, the true dist has the same mean but smaller variance. The pspline function uses an evenly spaced set of symmetric basis functions. A neat consequence of this is that the Wald test for linear vs 'more general' is a test that the coefficients of the spline terms fall in a linear series. That is, a linear trend test on the coefficients. This is what coxph does. As with the LR test, the chi-square dist is conservative. I have not worked at putting in the more correct distribution. See Eilers and Marx, Statistical Science 1986. > And what is the null for the non-linear test? The linear test is "is a linear better than nothing", the non-linear one is a sequential test "is the non-linear better than the linear". The second test of course depends on the total number of df you allowed for the pspline fit. As a silly example adding "+ pspline(x, df=200)" would likely show that the nonlinear term was not a significant addition, i.e., not worth 199 more degrees of freedom. Terry Therneau