最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

r - Add censor marks in weighted survival analysis - Stack Overflow

programmeradmin2浏览0评论

How can I add censor mark using the ggsurvfit package in a weighted survival analysis? I've run into the following bug:

Error in ggplot2::geom_point(): ! Problem while computing layer data. i Error occurred in the 2nd layer. Caused by error in tidyr::uncount(): ! Can't convert from weights double to integer due to loss of precision.

Code to reproduce the error:

library(ggsurvfit)
library(tidyverse)

df_lung%>%
  mutate(random_weight = rexp(1))%>%
  survfit2(Surv(time, status) ~ sex, data = ., weight = random_weight) %>%
  ggsurvfit()+
  add_censor_mark()
发布评论

评论列表(0)

  1. 暂无评论