Y
2013-Nov-02  19:24 UTC
[R] How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
I can easily get the other parameter estimates by using coxph() but don't know how to get the baseline hazard estimates from it. Does anyone know how to obtain nonparametric baseline hazard estimates in the gamma frailty model? Thanks, YH [[alternative HTML version deleted]]
Terry Therneau
2013-Nov-04  22:29 UTC
[R] How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
On 11/03/2013 05:00 AM, r-help-request at r-project.org wrote:> I can easily get the other parameter estimates by using coxph() but don't > know how to get the baseline hazard estimates from it. Does anyone know how > to obtain nonparametric baseline hazard estimates in the gamma frailty > model? > > Thanks, > YH >I don't see what the problem is. fit1 <- coxph(Surv(time, status) ~ age + ph.ecog + frailty(inst), data=lung) sfit <- survfit(fit1) plot(sfit) Please give an actual example of the problem. Terry Therneau
Y
2013-Nov-05  02:48 UTC
[R] How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
Hi Dr. Therneau, Yes, -log(sfit$surv) gives me the cumulative hazard but not the baseline cumulative hazard. I know that Nielsen and Klein have SAS Macros to get such estimates by using EM approach. I'm wondering if I can obtain the baseline hazard estimates from coxph() for gamma frailty model since I think coxph() is a very powerful function. I feel there may be some way that I don't know. Thanks, YH On Mon, Nov 4, 2013 at 6:27 PM, Terry Therneau <therneau@mayo.edu> wrote:> The cumulative hazard is just -log(sfit$surv). > The hazard is essentially a density estimate, and that is much harder. > You'll notice that everyone does CDF curves for survival data ( > Kaplan-Meier = estimate of 1-CDF), but no one does histograms, which > estimate a density. That isn't because we wouldn't like density estimates. > > Terry T. > > > > On 11/04/2013 04:47 PM, Y wrote: > >> Hi Dr. Therneau, >> >> Thanks very much for your kind help! Does survfit() just give me the >> survival curve? What >> I wanted is the baseline hazard estimates, i.e., lambda_{0} (t). How can >> I obtain this >> estimate from coxph()? Or using basehaz()? >> >> Thanks, >> YH >> >> >> >> >> >> >> >> >> >> >> On Mon, Nov 4, 2013 at 5:29 PM, Terry Therneau <therneau@mayo.edu >> <mailto:therneau@mayo.edu>> wrote: >> >> >> >> On 11/03/2013 05:00 AM, r-help-request@r-project.org >> <mailto:r-help-request@r-project.org> wrote: >> >> I can easily get the other parameter estimates by using coxph() >> but don't >> know how to get the baseline hazard estimates from it. Does >> anyone know how >> to obtain nonparametric baseline hazard estimates in the gamma >> frailty >> model? >> >> Thanks, >> YH >> >> >> I don't see what the problem is. >> >> fit1 <- coxph(Surv(time, status) ~ age + ph.ecog + frailty(inst), >> data=lung) >> sfit <- survfit(fit1) >> plot(sfit) >> >> >> Please give an actual example of the problem. >> >> Terry Therneau >> >> >>[[alternative HTML version deleted]]
Terry Therneau
2013-Nov-05  14:02 UTC
[R] How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
I have responded to this particular misconception so often I begin to grow
grumpy about it
(not the particular fault of YH).  The cumulative hazard function from
	fit <- coxph( some model)
         sfit <- survfit(fit, newdata=  set of covariate values)
gives the survival curve and cumulative hazard for that particular set of
covariate values.
There is nothing special about a "baseline hazard".  Any cumulative
hazard is for some
particular set of covariate values, including "all values =0" which is
what most textbooks
refer to as the baseline.  The survfit routine will by default return one
centered at the
means of the predictor variables, simply because there is less round off error
if one
stays near the center.  Any baseline is as good as any other.
   cum haz at covariate values "z" = cumulative haz for values
"x" * exp(beta * (z-x))
Note that for a random effect, the survfit routine uses 0 as the centering
value.
Terry Therneau
On 11/05/2013 05:00 AM, r-help-request at r-project.org
wrote:> Hi Dr. Therneau,
>
> Yes, -log(sfit$surv) gives me the cumulative hazard but not the baseline
> cumulative hazard. I know that Nielsen and Klein have SAS Macros to get
> such estimates by using EM approach. I'm wondering if I can obtain the
> baseline hazard estimates from coxph() for gamma frailty model since I
> think coxph() is a very powerful function. I feel there may be some way
> that I don't know.
>
> Thanks,
> YH