[R] Estimate and plot hazard function using "muhaz" package

Ken Beath kjbeath at kjbeath.com.au
Wed Jan 24 00:44:21 CET 2007


On 24/01/2007, at 10:34 AM, Deming Mi wrote:

> Dear R users,
> I am trying to use "muhaz" and "plot.muhaz" functions in "muhaz"  
> package to
> estimate and plot hazard funciton.  However function "muhaz" always  
> gives
> error message "Error in Surv(times, delta) : object "times" not  
> found".  I
> could not even run their sample codes in the user's manual as follows:
>
> data(ovarian)
> attach(ovarian)
> fit1 <- muhaz(futime, fustat)
>
> it gave the same error message.  By the way, the "survival" package is
> installed and functions well on my computer.
>
> Does anyone have the same problem?  Thanks!
>
> Deming
>

Works perfectly

 > data(ovarian)
 > attach(ovarian)
 > fit1 <- muhaz(futime, fustat)
 >
 > fit1
$pin
$pin$times
[1]   59  115  156  268  329  353  365  377  421  431  448  464  475   
477  563  638  744  769  770  803  855 1040 1106 1129 1206 1227

$pin$delta
[1] 1 1 1 1 1 1 1 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0

$pin$nobs
[1] 26

etc

Ken



More information about the R-help mailing list