When you fit a penalized Cox model, either frailty or psplines, the
returned object contains a "df" component. For instance, using the
kidney transplant data of McGilchrist
McGilchrist and Aisbett, Biometrics 47, 461-66, 1991
kidney <- read.table('data.kidney', col.names=c("id", "time", "status",
"age", "sex", "disease", "frail"))
> coxph(Surv(time, status) ~ age + sex, kidney)
Call:
coxph(formula = Surv(time, status) ~ age + sex, data = kidney)
coef exp(coef) se(coef) z p
age 0.00203 1.002 0.00925 0.22 0.8300
sex -0.82933 0.436 0.29895 -2.77 0.0055
Likelihood ratio test=7.12 on 2 df, p=0.0285 n= 76
> kfit4 <- coxph(Surv(time, status) ~ age + sex + frailty(id),
data=kidney)
> kfit4
coef se(coef) se2 Chisq DF p
age 0.00522 0.0119 0.0088 0.19 1.0 0.66000
sex -1.58335 0.4594 0.3515 11.88 1.0 0.00057
frailty(id) 22.97 12.9 0.04100
Iterations: 7 outer, 49 Newton-Raphson
Variance of random effect= 0.408 M-likelihood = -181.6
Degrees of freedom for terms= 0.6 0.6 12.9
Likelihood ratio test=46.6 on 14.06 df, p=2.36e-05 n= 76
The AIC for the two models is based on 2 and 14 degrees of freedom,
respectively (note the last lines). The total df for a non-penalized
model is sum(!is.na(fit$coef)), the check for NA is important only when
one fits an overparameterized model. For a penalized model the
df is sum(fit$df).
Terry Therneau
Terry M. Therneau, Ph.D. (507) 284-3694
Head, Section of Biostatistics (507) 284-9542 FAX
Mayo Clinic therneau.terry@mayo.edu
Rochester, Minn 55905
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|