Reputation: 67
After running a cox proportional hazards model with penalized splines, the summary table truncates the row names of the coefficients. Is there a way to print the full parameter or to increase the truncation limit to ensure full row names.
Modeling some dummy data:
library(survival)
dummy = data.frame(
survival = c(0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1),
time = c(60,120,180,240,300,360,60,120,180,240,60,120,180,240,300,360,420,480,60,120,180,60,120,180,240),
cov1 = c(9.1,7.3,8.2,0.9,0.7,8.7,6.3,7.6,1.5,2.9,1.9,1.3,6.4,1.3,8.9,1.6,7.8,1.2,0.8,5.4,3.5,2.2,4.8,9.3,5.5),
covariate2 = c(323,378,261.5,324,492,246.5,330.5,268,77.5,254.5,216,224,206,159.5,76,227.5,444,379,71,232,139,461,366,380,350.5))
mod_survival <- coxph(Surv(time, survival) ~ pspline(cov1) + pspline(covariate2, df = 2), data = dummy)
summary <- summary(mod_survival)
summary$coefficients
Results in the following:
> summary$coefficients
coef se(coef) se2 Chisq DF p
pspline(cov1), linear 0.01186380 4.180302 4.042494 8.054382e-06 1.0000000 0.9977356
pspline(cov1), nonlin NA NA NA 1.090602e-01 6.4931508 0.9999908
pspline(covariate2, df = -0.04858999 8.095739 7.212111 3.602306e-05 1.0000000 0.9952112
pspline(covariate2, df = NA NA NA 2.154301e-10 -0.2063786 0.9964457
How can I print out the something like below?
coef se(coef) se2 Chisq DF p
pspline(cov1), linear 0.01186380 4.180302 4.042494 8.054382e-06 1.0000000 0.9977356
pspline(cov1), nonlin NA NA NA 1.090602e-01 6.4931508 0.9999908
pspline(covariate2, df = 2), linear -0.04858999 8.095739 7.212111 3.602306e-05 1.0000000 0.9952112
pspline(covariate2, df = 2), nonlin NA NA NA 2.154301e-10 -0.2063786 0.9964457
Upvotes: 2
Views: 84
Reputation: 694
The maxlabel
argument in the summary.coxph.penal()
function controls the length of coefficient names. You can see the source code by running getAnywhere(summary.coxph.penal)
after loading the survival package. The default value is maxlabel = 25
, as you can see from the example.
Changing the summary()
call to summary <- summary(mod_survival, maxlabel = 35)
, or a greater number, solves your issue.
Upvotes: 1