I thought this would be trivial, but I can't find a package or function that does this. I'm hoping someone can guide me to one. Imagine a simple case with two survival curves (e.g. treatment & control). I just want to calculate the difference in KM estimates at a specific time point (e.g. 1 year) plus the estimate's 95% CI. The former is straightforward, but the estimates not so much. I know methods exist such as Parzen, Wei, and Ying, but was surprised not to find a package that included this. Before I code it up, I thought I'd ask if I was just missing it somewhere. Thank you Jason [[alternative HTML version deleted]]
On Thu, Mar 8, 2012 at 4:50 AM, Jason Connor <jconnor at alumni.cmu.edu> wrote:> I thought this would be trivial, but I can't find a package or function > that does this. > > I'm hoping someone can guide me to one. > > Imagine a simple case with two survival curves (e.g. treatment & control). > > I just want to calculate the difference in KM estimates at a specific time > point (e.g. 1 year) plus the estimate's 95% CI. ?The former is > straightforward, but the estimates not so much. > > I know methods exist such as Parzen, Wei, and Ying, but was surprised not > to find a package that included this. > > Before I code it up, I thought I'd ask if I was just missing it somewhere.summary.survfit() in the survival package will give you the point estimate and standard error, and then combining these into a difference and confidence interval for the difference is easy. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland
Did you try the survival package? On Wed, 07-Mar-2012 at 10:50AM -0500, Jason Connor wrote: |> I thought this would be trivial, but I can't find a package or function |> that does this. |> |> I'm hoping someone can guide me to one. |> |> Imagine a simple case with two survival curves (e.g. treatment & control). |> |> I just want to calculate the difference in KM estimates at a specific time |> point (e.g. 1 year) plus the estimate's 95% CI. The former is |> straightforward, but the estimates not so much. |> |> I know methods exist such as Parzen, Wei, and Ying, but was surprised not |> to find a package that included this. |> |> Before I code it up, I thought I'd ask if I was just missing it somewhere. |> |> Thank you |> Jason |> |> [[alternative HTML version deleted]] |> |> ______________________________________________ |> R-help at r-project.org mailing list |> https://stat.ethz.ch/mailman/listinfo/r-help |> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html |> and provide commented, minimal, self-contained, reproducible code. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
--begin included message -- I thought this would be trivial, but I can't find a package or function that does this. I'm hoping someone can guide me to one. Imagine a simple case with two survival curves (e.g. treatment & control). I just want to calculate the difference in KM estimates at a specific time point (e.g. 1 year) plus the estimate's 95% CI. The former is straightforward, but the estimates not so much. -------------- end inclusion ---------- As others have pointed out, use "survfit". Because the curves are step functions, they likely won't have a stored value in the data at exactly 365 days. The summary() function for survival curves allows you to read off the curve's values at any arbitrary time point. A note on standard errors: S(t) +- std is a terrible confidence interval. You will be much more accurate if you use log scale. (Some argue for logit or log-log, in truth they work well.) If n is large enough, however, you should be ok. Terry T.
On Fri, Mar 9, 2012 at 3:08 AM, Terry Therneau <therneau at mayo.edu> wrote:> A note on standard errors: ?S(t) +- std is a terrible confidence > interval. ?You will be much more accurate if you use log scale. ?(Some > argue for logit or log-log, in truth they work well.) ? If n is large > enough, however, you should be ok.Very true, but if one really wants a confidence interval for S_1(t)-S_2(t) (not for S_1(t)/S_2(t)) then one is pretty much forced to use the raw probability scale. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland
Possibly Parallel Threads
- How to get the 5th percentile( with a 95% CI )of the Kaplan-meier estimator?
- Kaplan Meier analysis: 95% CI wider in R than in SAS
- how to read this special form of data
- Extreme bunching of random values from runif with Mersenne-Twister seed
- Weighted Kaplan-Meier estimates with R