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.
Questions tagged [survival]
445 questions
0
votes
0 answers
gestate::event_prediction for predicting events for a study with enrollment completed
Is it possible to use gestate::event_prediction to predict event timing for a study with enrollment completed? event_prediction has a parameter for rcurve, which I am not sure how to input for a enrollment completed study. Here's is the example from…

user2272972
- 131
- 1
- 11
0
votes
0 answers
What is the maximum follow-up time to use when comparing several cohorts in a survival analysis?
It has been a long time since I last performed a survival analysis, and I have a basic question about it. I have three cohorts, each with a different median follow-up time value that I have calculated using the reverse Kaplan-Meier estimator. The R…

EI_Stats
- 21
- 2
0
votes
1 answer
How to generate a smoothed hazard plot in R?
I am trying to replicate some analyses that someone performed in Stata. They used a function (or program as they are called in Stata?) called "stexpect3" to generate a "smoothed hazard plot" like this. Wondering if anyone can point me in the…

krtbris
- 344
- 1
- 9
0
votes
0 answers
How can I transform my data to be used by tmerge and a multistate survival model?
I am currently trying to model a multi-state survival problem. Subjects can be in one of 1 states (A through C). All states are sequentially entered and there is no reversal or jumping (i.e You must go from A-> B -> C in order, you can't go from…

Demetri Pananos
- 6,770
- 9
- 42
- 73
0
votes
1 answer
Editing Axis Title in Schoenfeld Residuals Plot
I'd like to edit the y-axis titles of my Schoenfeld residuals plot, which currently say, "Beta(t) for [variable name]" where [variable name] is the variable's data entry name rather than its label name. For instance, I'd like to change "Beta(t) for…

Bren
- 33
- 4
0
votes
1 answer
How to change the decimal separator in a ggsurvplot?
I would like to change the decimal separator of all the numbers (risk table, x and y axis, as well as p-value) in a Kaplan Meier curve from "." to "," (e.g. from 3.1415 to 3,1415). For the graph I use ggsurvplot from the survival package in R.
I…

kobue1
- 43
- 4
0
votes
0 answers
RMST2 covariates do not produce confidence intervals
I am using the rmst2 package on R. When i run the model without covariates, I get this result:
Restricted Mean Survival Time (RMST) by arm
Est. se lower .95 upper .95
RMST (arm=1) 9.788 0.279 9.241 10.334
RMST (arm=0)…
0
votes
0 answers
RMS vs SURVIVAL package - Cox model - different wald value
I want to study the pvalue of the variables included in my Cox model.
I compare this two results :
library(survival)
library(rms)
n <- 1000
set.seed(731)
age <- 50 + 12*rnorm(n)
label(age) <- "Age"
sex <- factor(sample(c('Male','Female'), n,
…

Sle R.
- 87
- 7
0
votes
0 answers
Problems with the reproduction in R of survival analysis results originally generated in Stata?
I am attempting to reproduce some survival analysis results published in a journal. The original results were produced in Stata. Here is the code:
* COUPS
gen c_coup=c
replace c_coup=0 if exit!="coup"
stset time, id(leadid) failure(c_coup)
* REVOLT…

w5698
- 159
- 7
0
votes
0 answers
Loop/iterate over many columns in R for Cox proportional hazards regression
I have a great number of events to analyse, all in separate columns as shown in my example below. I would like to create a model for each column labeled IDXX, through a FOR loop, in R.
However, the code always returns the error Time and status are…

pyyyour
- 1
- 2
0
votes
0 answers
How to build a Cox PH model manually (from coefficient found in coxph function)?
I built a cox PH model with the following code:
library(rms)
cox1 <- cph(Surv(survival_time, event) ~ var1 + var2 + var3 + var4, data = myDataBase)
summary(cox1)
Now I want to predict a survival probability at 12/24/36 months for a new…

B_slash_
- 309
- 2
- 17
0
votes
0 answers
Mortality table | Extrapolation of rates to older ages
I am currently working on the construction of an experience mortality table. My problem is with the methods of extrapolation of the smoothed rates that I have obtained. I'm really struggling to implement an R code that will allow me to extrapolate…
0
votes
0 answers
Overall survival plots of two cohorts and probability at specific time points
I want to calculate the overall survival of two cohorts. "dat" is the dataframe containing the data. The follow-up time of the patients is recorded in "follow_up_TIME" and "EXITUS" is a categorical variable where 0 = alive and 1 = death. I need to…

EI_Stats
- 21
- 2
0
votes
1 answer
R survminer::ggsurvplot can't combine due to "atomic vector"?
Reproducible example:
require(Survival)
require(survminer)
require(ggplot2)
set.seed(42)
a <- c(32,291,545, 44,3,792,352, 20,615,169, 61,156, 88,863,255, 33,132,5,
63,8,964,831, 55,133, 12, 54,261,867, 17, 12,699,233,251,446, 43,223,
…

Reader 123
- 285
- 1
- 7
0
votes
1 answer
Rshiny with Xgboost error: xgb.DMatrix does not support construction from closure
I am creating an Rshiny app to run a an xgboost survival model. To do this, the categorical variables in the UI need to be entered into the model as one hot encoded variables. I created a blank dataframe and then used reactive values to adjust the…

yussel60
- 13
- 3