I attempted to plot the hazard function after I fit my aftreg. However, it shows an error:
Error in if (any(shape <= 0) || any(scale <= 0)) stop("scale and shape must be positive") :
missing value where TRUE/FALSE needed
After some inspections, I realize it is because I fitted aftreg with an exponential distribution by setting dist = "weibull", shape = 1 (as instructed by the package help page), but the shape is not properly assigned to the fitted object:
> fitted_exp$shape
<NA>
NA
After I manually assigned shape by fitted_exp$shape <- 1, the plot worked just fine. I hope there is some way that you can fix this issue in the aftreg.R file.
Hi there,
I attempted to plot the hazard function after I fit my aftreg. However, it shows an error:
After some inspections, I realize it is because I fitted aftreg with an exponential distribution by setting
dist = "weibull", shape = 1
(as instructed by the package help page), but theshape
is not properly assigned to the fitted object:After I manually assigned shape by
fitted_exp$shape <- 1
, the plot worked just fine. I hope there is some way that you can fix this issue in theaftreg.R
file.Thank you!
Cheers, Simon