Terry Therneau
2010-Nov-15 14:33 UTC
[R] interpretation of coefficients in survreg AND obtaining the hazard function
1. The weibull is the only distribution that can be written in both a proportional hazazrds for and an accelerated failure time form. Survreg uses the latter. In an ACF model, we model the time to failure. Positive coefficients are good (longer time to death). In a PH model, we model the death rate. Positive coefficients are bad (higher death rate). You are not the first to be confused by the change in sign between the two models. 2. There are about 5 different ways to parameterize a Weibull distribution, 1-4 appear in various texts and the acf form is #5. This is a second common issue with survreg that strikes only the more sophisticated users: to understand the output they look up the Weibull in a textbook, and become even more confused! Kalbfliesch and Prentice is a good reference for the acf form. The manual page for psurvreg has some information on this, as does the very end of ?survreg. The psurvreg page also has an example of how to extract the hazard function for a Weibull fit. ----Begin included message ---- Dear R help list, I am modeling some survival data with coxph and survreg (dist='weibull') using package survival. I have 2 problems: 1) I do not understand how to interpret the regression coefficients in the survreg output and it is not clear, for me, from ?survreg.objects how to. Here is an example of the codes that points out my problem: - data is stc1 - the factor is dichotomous with 'low' and 'high' categories slr <- Surv(stc1$ti_lr, stc1$ev_lr==1) mca <- coxph(slr~as.factor(grade2=='high'), data=stc1) mcb <- coxph(slr~as.factor(grade2), data=stc1) mwa <- survreg(slr~as.factor(grade2=='high'), data=stc1, dist='weibull', scale=0) mwb <- survreg(slr~as.factor(grade2), data=stc1, dist='weibull', scale=0)> summary(mca)$coefcoef exp(coef) se(coef) z Pr(>|z|) as.factor(grade2 == "high")TRUE 0.2416562 1.273356 0.2456232 0.9838494 0.3251896> summary(mcb)$coefcoef exp(coef) se(coef) z Pr(>|z|) as.factor(grade2)low -0.2416562 0.7853261 0.2456232 -0.9838494 0.3251896> summary(mwa)$coef(Intercept) as.factor(grade2 == "high")TRUE 7.9068380 -0.4035245> summary(mwb)$coef(Intercept) as.factor(grade2)low 7.5033135 0.4035245 No problem with the interpretation of the coefs in the cox model. However, i do not understand why a) the coefficients in the survreg model are the opposite (negative when the other is positive) of what I have in the cox model? are these not the log(HR) given the categories of these variable? b) how come the intercept coefficient changes (the scale parameter does not change)? 2) My second question relates to the first. a) given a model from survreg, say mwa above, how should i do to extract the base hazard and the hazard of each patient given a set of predictors? With the hazard function for the ith individual in the study given by h_i(t) = exp(\beta'x_i)*\lambda*\gamma*t^{\gamma-1}, it doesn't look like to me that predict(mwa, type='linear') is \beta'x_i. b) since I need the coefficient intercept from the model to obtain the scale parameter to obtain the base hazard function as defined in Collett (h_0(t)=\lambda*\gamma*t^{\gamma-1}), I am concerned that this coefficient intercept changes depending on the reference level of the factor entered in the model. The change is very important when I have more than one predictor in the model. Any help would be greatly appreciated, David Biau.
Biau David
2010-Nov-15 20:24 UTC
[R] Re : interpretation of coefficients in survreg AND obtaining the hazard function
Dear Prof Therneau, thank yo for this information: this is going to be most useful for what I want to do. I will look into the ACF model. Yours, David Biau. ________________________________ De : Terry Therneau <therneau@mayo.edu> Cc : r-help@r-project.org Envoyé le : Lun 15 novembre 2010, 15h 33min 23s Objet : Re: interpretation of coefficients in survreg AND obtaining the hazard function 1. The weibull is the only distribution that can be written in both a proportional hazazrds for and an accelerated failure time form. Survreg uses the latter. In an ACF model, we model the time to failure. Positive coefficients are good (longer time to death). In a PH model, we model the death rate. Positive coefficients are bad (higher death rate). You are not the first to be confused by the change in sign between the two models. 2. There are about 5 different ways to parameterize a Weibull distribution, 1-4 appear in various texts and the acf form is #5. This is a second common issue with survreg that strikes only the more sophisticated users: to understand the output they look up the Weibull in a textbook, and become even more confused! Kalbfliesch and Prentice is a good reference for the acf form. The manual page for psurvreg has some information on this, as does the very end of ?survreg. The psurvreg page also has an example of how to extract the hazard function for a Weibull fit. ----Begin included message ---- Dear R help list, I am modeling some survival data with coxph and survreg (dist='weibull') using package survival. I have 2 problems: 1) I do not understand how to interpret the regression coefficients in the survreg output and it is not clear, for me, from ?survreg.objects how to. Here is an example of the codes that points out my problem: - data is stc1 - the factor is dichotomous with 'low' and 'high' categories slr <- Surv(stc1$ti_lr, stc1$ev_lr==1) mca <- coxph(slr~as.factor(grade2=='high'), data=stc1) mcb <- coxph(slr~as.factor(grade2), data=stc1) mwa <- survreg(slr~as.factor(grade2=='high'), data=stc1, dist='weibull', scale=0) mwb <- survreg(slr~as.factor(grade2), data=stc1, dist='weibull', scale=0)> summary(mca)$coefcoef exp(coef) se(coef) z Pr(>|z|) as.factor(grade2 == "high")TRUE 0.2416562 1.273356 0.2456232 0.9838494 0.3251896> summary(mcb)$coefcoef exp(coef) se(coef) z Pr(>|z|) as.factor(grade2)low -0.2416562 0.7853261 0.2456232 -0.9838494 0.3251896> summary(mwa)$coef(Intercept) as.factor(grade2 == "high")TRUE 7.9068380 -0.4035245> summary(mwb)$coef(Intercept) as.factor(grade2)low 7.5033135 0.4035245 No problem with the interpretation of the coefs in the cox model. However, i do not understand why a) the coefficients in the survreg model are the opposite (negative when the other is positive) of what I have in the cox model? are these not the log(HR) given the categories of these variable? b) how come the intercept coefficient changes (the scale parameter does not change)? 2) My second question relates to the first. a) given a model from survreg, say mwa above, how should i do to extract the base hazard and the hazard of each patient given a set of predictors? With the hazard function for the ith individual in the study given by h_i(t) = exp(\beta'x_i)*\lambda*\gamma*t^{\gamma-1}, it doesn't look like to me that predict(mwa, type='linear') is \beta'x_i. b) since I need the coefficient intercept from the model to obtain the scale parameter to obtain the base hazard function as defined in Collett (h_0(t)=\lambda*\gamma*t^{\gamma-1}), I am concerned that this coefficient intercept changes depending on the reference level of the factor entered in the model. The change is very important when I have more than one predictor in the model. Any help would be greatly appreciated, David Biau. [[alternative HTML version deleted]]
Seemingly Similar Threads
- interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors
- Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors
- Re: Trusting and trusted domain (home mapping) problem
- Memory errors using lmer
- [patch 2/9] Guest page hinting: unused / free pages on s390.