Closed itsdfish closed 10 months ago
This package takes the same approach as survival
, which gives you estimates for the unique times. It appears that mice
is undoing that by mapping the estimates back to the observed times, which reinstates the duplicate entries: https://github.com/amices/mice/blob/1561578c68ccf2118c9a8423f4c8ebe336ae05b6/R/nelsonaalen.R#L48-L50
Got it. Thanks for clarifying. Given that using unique times is the norm, I will close this issue.
Not related to the issue as stated but it's interesting that in your figure Julia has a lower estimate of the hazard than R. I'm not sure why that is.
Yeah. That was part of my concern. I don't know how the algorithm works, but my naive hypothesis is that increasing the number of observations occurring at the same time, leads to an increase in the cumulative hazard. This is consistent with the observation that Julia and R agree when the duplicates are removed. I think it could be further tested by increasing the duplicates.
AFAICT, this appears to be because the mice function nelsonaalen
doesn't actually compute the Nelson-Aalen estimate of the cumulative hazard. It fits a Cox proportional hazards model with the default options and obtains the baseline hazard of the result. Notably, coxph
defaults to the Efron method of handling ties. This package's estimates agree with the baseline cumulative hazard from coxph
when using the exact partial likelihood or Breslow's method.
Hello,
I noticed that Julia and R differ on an example from the MICE documentation. Initially, I thought this was related to #50, but upon closer inspection, I noticed that Julia removes duplicate times (R and Julia agree when duplicates are removed). It might be a good idea to explain this in the documentation, or perhaps not remove duplicates (return a warning instead?). I'm not sure what the best approach is or whether there is a best approach, but I think documenting the difference from R would be helpful to users.
R Code
require(MASS)
Julia Code
Version Info