Questions tagged [survival]

Survival analysis compares the statistical strength of predictors for events encoded as occuring or censored in concert with a time variable. It can be parametric or non-parametric.

445 questions
0
votes
0 answers

R : why do NAs appear in my survival estimate when I have a large dataset?

I am using the frailtySurv package to obtain estimates of the cumulative hazard of frailty survival data (I know this package was removed from the CRAN a few weeks ago but I really need to use this package). I noticed that when I am asking estimates…
Flora Grappelli
  • 659
  • 9
  • 26
0
votes
1 answer

How to get incidence rate and 95% CI of survival analysis in R?

I could get the survival rate and it's 95% CI in this way: library(survival) library(survminer) lung lung$survobj1=with(lung,Surv(time,status==2)) fit1 <- survfit(survobj1 ~ 1, data = lung, conf.type = "log-log") summary(fit1,times = seq(0, 19) *…
Robin
  • 325
  • 2
  • 12
0
votes
1 answer

tmerge() + coxph(): two ways of setting up dates should give same results, and don't

Basically, using tmerge() to create data for time-varying-covariate Cox regression, two ways of expressing times should give the same regression results (I think), but they don't. One way uses start and end dates, and converts to numeric within…
eac2222
  • 161
  • 7
0
votes
0 answers

SemiCompRisks package and encourage to one error

Blockquote strong text> - ``` library(Formula) library(SemiCompRisks) library(haven) CRC_Final_04 <- read_sav("X0_CRC_Final_04.sav") CRC_Final_04 <- read_sav("C:/Users/Uaer/Downloads/X0_CRC_Final_04.sav") scrdata <- CRC_Final_04 names…
0
votes
0 answers

Error add_pvalue and add_confidence_interval in ggsurvfit

I am trying to create Kaplan-Meier survival curves from data that is both left and right censored. I would like these curves to have associated confidence intervals if possible and to include a Log rank p-value on the figure. However, I am having…
Pat Taggart
  • 321
  • 1
  • 9
0
votes
1 answer

How to get the exact same standard errors obtained in Stata when reproducing survival analysis in R?

I am reproducing in R some survival analysis results published in a journal. The original results were produced in Stata. Here are the original results: Here is the code to produce these results in R: # load…
w5698
  • 159
  • 7
0
votes
0 answers

How to create ggsurvfit facet plot

Within the '''library(ggsurvfit)''' package, how do you create a facet plot using the ggsurvfit() function? I was under the impression that library(ggsurvfit) integrated with ggplot2 and so facet should be as normal. Hence I tried the below but with…
Pat Taggart
  • 321
  • 1
  • 9
0
votes
2 answers

How to change the color of the group names in the risk table to be all black in R survminer package using ggsurvplot?

I am working on a survival plot using the survminer package and ggsurvplot. I am using the option to get a risk table (i.e. risk_table = T). The risk table immediately outputs with rows for each group in my survival plot. Each label for the risk…
0
votes
0 answers

How can I plot the hazard function for a coxreg() object using the eha package?

Using the eha package, it is possible to plot coxreg() objects. One of the parameters of plot.coxreg is fn = c("cum", "surv", "log", "loglog"). The argument "cum" gives the plot for the cumulative hazard function as shown here, using the following…
Cloft X
  • 141
  • 7
0
votes
0 answers

R programming variance longer object length is not a multiple of shorter object length error

I am attempting this question to calculate the variance using a survival function I have calculated, and this is my approach, however I am not sure why there is an error. Can someone kindly please help me out? survfunc <- cancer_obs$KM B <- 100 N…
trying
  • 1
0
votes
0 answers

Ensuring comparability of results when reproducing Stata survival analysis in R

I am using a Bayesian latent variable model to develop a measure. The goal is then to use the measure to replicate some existing studies to see if the results hold. I am replicating a study that uses survival analysis. Note that the original results…
w5698
  • 159
  • 7
0
votes
0 answers

How can I plot the hazard function for a coxreg() object using the eha package?

Using the eha package, it is possible to plot coxreg() objects. One of the parameters of plot.coxreg is fn = c("cum", "surv", "log", "loglog"). The argument "cum" gives the plot for the cumulative hazard function as shown here, using the following…
Cloft X
  • 141
  • 7
0
votes
1 answer

How to plot hazard function in R using ggplot2?

There's a book called "Event History Analysis with R" by G. Broström. But it provides minimal R code for whatever concepts are presented. I'd like to plot a hazard function, how do I do that? I want the exact same plots as given here. The plots…
Cloft X
  • 141
  • 7
0
votes
0 answers

Survival sample size calculation

I want to calculate the sample size for a survival study of patients with acute myeloid leukemia, with two cohorts, one receiving chemotherapy and the other not. I want an event-free survival (EFS) at 1 year of 40% with a margin of 5%. The…
EI_Stats
  • 21
  • 2
0
votes
1 answer

Error: "Ops.Surv(y, mass.p) : Invalid operation on a survival time' when trying to fit a censored zero-inflated gamma (ZAGA) distribution in GAMLSS

I have a dataset with response variable y that takes values between 0 and 100 and an explanatory variable age that takes values between 18 and 70. To construct a model, a GAMMA distribution seemed fine for the response variable y. Since 80% of the…