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
1
vote
1 answer

Is there a way to predict future survival probabilities in R?

Here is a sample dataset below: age = runif(200, min = 25, max=70) profile_id = seq(1, 200) gender = sample(c("M", "F"), size = 200, replace = T) start_date = sample(seq(as.Date('2013/01/01'), as.Date('2014/01/01'), by="month"), 200, replace =…
Imconfused
  • 31
  • 1
  • 5
1
vote
0 answers

how to do survdiff on two separate survival curves in R?

I have two separate survival Kaplan-Myer curve. I wonder how I can get the p value of the difference between these two survival curve. survdiff or survminer::surv_pvalue only work if there is a predictor like sex, adhere etc. …
zesla
  • 11,155
  • 16
  • 82
  • 147
1
vote
0 answers

Why modelling in R consumes more memory than the returned object

When performing survival analysis in R, fitting a model is reported to consume more memory, than the actual object being returned. Moreover, this seems to happen only a few times, not for every…
mjktfw
  • 840
  • 6
  • 14
1
vote
1 answer

Add a line to survminer survival plot

I have the following survival curve require("survival") library(survminer) fit <- survfit(Surv(time, status) ~ 1, data = lung) ggsurvplot(fit, palette = "jco",risk.table = TRUE) I would like to add to the plot the non-straight line with x…
ECII
  • 10,297
  • 18
  • 80
  • 121
1
vote
1 answer

coxph ran out of iterations - won't converge, categorical treatment, continuous covariates

I am trying to run a Cox proportional hazard model to determine the effect of treatment and covariates on the survival of individual plant species. Previously when I ran coxph with only the treatment (categorical/factor) simacox <- coxph(Surv(Time,…
Justin Luong
  • 31
  • 1
  • 11
1
vote
1 answer

differences in survival function outputs for three treatment groups

(Skip to the bottom for update and new code and data) I am trying to plot a survival curve with interval censor data. I have been able to successfully plot the survival curve using the interval censor data (shown below), although I am not sure if I…
Justin Luong
  • 31
  • 1
  • 11
1
vote
1 answer

R Flexsurv- estimating a survival function

I have a survival kapplan-Meier curves and I want to extrapolate different model curves (e.g. Weibull, Gompertz,...) using the flexsurv package. I have succeed to do the extrapolation but I do not find the solution to create a matrix of the…
Carine
  • 11
  • 4
1
vote
1 answer

Stata: How do I clear sts graphs from memory?

I have the following code: graph drop _all sts graph if year==2014, saving(14) sts graph if year==2015, saving(15) sts graph if year==2016, saving(16) gr combine 14.gph 15.gph 16.gph I would like to add a line that will clear the previous graph…
Stata_user
  • 562
  • 3
  • 14
1
vote
1 answer

Overlay different ggplot2 objects

I have previously tried to ask for help but did not actually solve my problem. More info can be found here: (you can find the data-set here)…
prophet
  • 85
  • 1
  • 12
1
vote
1 answer

Survival analysis combining survfit and ggplot objects

A little background that might be useful. I am in a position that I have two plots that need to be combined. I have used the "survival" package to generate a Kaplan-Meier curve from a set of data. I have also created and used a custom function to…
prophet
  • 85
  • 1
  • 12
1
vote
0 answers

survival::survreg user-defined Beta distribution

I have a data set with a dependent right-censored variable distributed over the Beta distribution. Please do not offer flexsurv package. It is necessary to describe the function of my Beta distribution for use in the AFT regression survival model…
1
vote
1 answer

Find R-square value of Weibull fit (Survival model) in R

I have a survival object (S) for which I am doing a weibull fit using the survreg function and weibull distribution in R. S = Surv(data$ValueX, data$ValueY) W = Survreg(S ~ 1, data=data, dist="weibull") How do I extract the R-square value of the…
Nim
  • 21
  • 2
1
vote
0 answers

including time dependent covariates in Cox's Regression in R

I have a datset that looks like: Treatment Surface ex.time excision antib.time antibiotic inf.time infection 1 0 15 12 0 12 0 12 0 2 0 20 9 0 9 0 …
user1607
  • 531
  • 7
  • 28
1
vote
1 answer

Survival function - interpolation in R

I have constructed a survival function such as: [![plot(survfit(Surv(inf.time,infection)~1),xlab="Time (days)",ylab="Survival Probability", main="Time Until Staphylococcus Infection", conf.int =…
user1607
  • 531
  • 7
  • 28
1
vote
1 answer

Generate survival curve with both time-dependent covariate and time varying coefficient

I want code to generate survival curves in a setting with both time dependent covariates and time varying coefficients. The goal is to demonstrate how billing method affects life insurance policy lapse. It’s complex in that a customers…
PdV
  • 53
  • 1
  • 6