I tested the assumptions for CoxCox proportional hazards model on my time-to-event data. I found that the assumption of linearity between independent variables and model residuals is violated. After
After some reading I realized that I could use pspline with 4 degrees of freedom to handle non-linearity. My coxCox model has 2 explanatory continuous variables both of which are non-linear. Here
Here is the output of the coxph with pspline of both variables:
Call: recsurve <- Surv(timetoevent,convert) coxph(formula = recsurve ~ pspline(Occipital_lGI, df = 4) + pspline(Prefrontal_lGI, df = 4), data = C_NC_pref_occ_lGI)
n= 72, number of events= 24
Call: recsurve <- Surv(timetoevent,convert)
coxph(formula = recsurve ~ pspline(Occipital_lGI, df = 4) +
pspline(Prefrontal_lGI, df = 4), data = C_NC_pref_occ_lGI)
n= 72, number of events= 24
coef se(coef) se2 Chisq DF p
pspline(Occipital_lGI, df 1.794 1.594 1.542 1.27 1.00 0.2600 pspline(Occipital_lGI, df 1.48 3.00 0.6900 pspline(Prefrontal_lGI, d 5.724 2.153 2.096 7.07 1.00 0.0078 pspline(Prefrontal_lGI, d 5.80 2.99 0.1200
pspline(Occipital_lGI, df 1.794 1.594 1.542 1.27 1.00 0.2600
pspline(Occipital_lGI, df 1.48 3.00 0.6900
pspline(Prefrontal_lGI, d 5.724 2.153 2.096 7.07 1.00 0.0078
pspline(Prefrontal_lGI, d 5.80 2.99 0.1200
exp(coef) exp(-coef) lower .95 upper .95
ps(Occipital_lGI)3 0.39212 2.5502 4.405e-03 3.491e+01
ps(Occipital_lGI)4 0.20268 4.9339 5.591e-04 7.347e+01
ps(Occipital_lGI)5 0.21215 4.7135 7.094e-04 6.345e+01
ps(Occipital_lGI)6 0.28838 3.4676 1.146e-03 7.256e+01
ps(Occipital_lGI)7 0.19500 5.1281 7.183e-04 5.294e+01
ps(Occipital_lGI)8 0.31445 3.1802 1.099e-03 8.997e+01
ps(Occipital_lGI)9 0.65732 1.5213 2.354e-03 1.836e+02
ps(Occipital_lGI)10 0.69503 1.4388 2.392e-03 2.019e+02
ps(Occipital_lGI)11 0.62975 1.5879 1.540e-03 2.576e+02
ps(Occipital_lGI)12 0.69336 1.4423 3.600e-04 1.335e+03
ps(Occipital_lGI)13 0.85750 1.1662 2.450e-05 3.001e+04
ps(Occipital_lGI)14 1.08123 0.9249 3.405e-07 3.433e+06
ps(Prefrontal_lGI)3 0.61636 1.6224 1.416e-03 2.683e+02
ps(Prefrontal_lGI)4 0.38646 2.5876 1.447e-05 1.032e+04
ps(Prefrontal_lGI)5 0.26852 3.7242 8.383e-07 8.601e+04
ps(Prefrontal_lGI)6 0.25250 3.9603 2.823e-07 2.258e+05
ps(Prefrontal_lGI)7 0.19687 5.0794 2.096e-07 1.849e+05
ps(Prefrontal_lGI)8 0.08341 11.9884 1.155e-07 6.023e+04
ps(Prefrontal_lGI)9 0.17187 5.8183 2.685e-07 1.100e+05
ps(Prefrontal_lGI)10 0.46969 2.1291 7.953e-07 2.774e+05
ps(Prefrontal_lGI)11 0.83136 1.2029 1.313e-06 5.264e+05
ps(Prefrontal_lGI)12 1.34341 0.7444 1.943e-06 9.288e+05
ps(Prefrontal_lGI)13 2.05412 0.4868 2.699e-06 1.563e+06
ps(Prefrontal_lGI)14 3.16502 0.3160 1.929e-06 5.193e+06
Iterations: 4 outer, 13 Newton-Raphson
Theta= 0.1809375
Theta= 0.1955302
Degrees of freedom for terms= 4 4
Concordance= 0.727 (se = 0.061 )
Likelihood ratio test= 18.14 on 7.99 df, p=0.02
ps(Occipital_lGI)3 0.39212 2.5502 4.405e-03 3.491e+01 ps(Occipital_lGI)4 0.20268 4.9339 5.591e-04 7.347e+01 ps(Occipital_lGI)5 0.21215 4.7135 7.094e-04 6.345e+01 ps(Occipital_lGI)6 0.28838 3.4676 1.146e-03 7.256e+01 ps(Occipital_lGI)7 0.19500 5.1281 7.183e-04 5.294e+01 ps(Occipital_lGI)8 0.31445 3.1802 1.099e-03 8.997e+01 ps(Occipital_lGI)9 0.65732 1.5213 2.354e-03 1.836e+02 ps(Occipital_lGI)10 0.69503 1.4388 2.392e-03 2.019e+02 ps(Occipital_lGI)11 0.62975 1.5879 1.540e-03 2.576e+02 ps(Occipital_lGI)12 0.69336 1.4423 3.600e-04 1.335e+03 ps(Occipital_lGI)13 0.85750 1.1662 2.450e-05 3.001e+04 ps(Occipital_lGI)14 1.08123 0.9249 3.405e-07 3.433e+06 ps(Prefrontal_lGI)3 0.61636 1.6224 1.416e-03 2.683e+02 ps(Prefrontal_lGI)4 0.38646 2.5876 1.447e-05 1.032e+04 ps(Prefrontal_lGI)5 0.26852 3.7242 8.383e-07 8.601e+04 ps(Prefrontal_lGI)6 0.25250 3.9603 2.823e-07 2.258e+05 ps(Prefrontal_lGI)7 0.19687 5.0794 2.096e-07 1.849e+05 ps(Prefrontal_lGI)8 0.08341 11.9884 1.155e-07 6.023e+04 ps(Prefrontal_lGI)9 0.17187 5.8183 2.685e-07 1.100e+05 ps(Prefrontal_lGI)10 0.46969 2.1291 7.953e-07 2.774e+05 ps(Prefrontal_lGI)11 0.83136 1.2029 1.313e-06 5.264e+05 ps(Prefrontal_lGI)12 1.34341 0.7444 1.943e-06 9.288e+05 ps(Prefrontal_lGI)13 2.05412 0.4868 2.699e-06 1.563e+06 ps(Prefrontal_lGI)14 3.16502 0.3160 1.929e-06 5.193e+06
Iterations: 4 outer, 13 Newton-Raphson Theta= 0.1809375 Theta= 0.1955302 Degrees of freedom for terms= 4 4 Concordance= 0.727 (se = 0.061 ) Likelihood ratio test= 18.14 on 7.99 df, p=0.02
Can anyone explain which p-values I have to look at? Whether
Whether any of the 2 variables is significant?? why
Why there are 2 p values for each variable marked as df and d?
Any guidance would be appreciated.