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
6
votes
1 answer

Change x-axis labels for ggsurvplot

library(survival) library(survminer) I am using the survminer package to plot unadjusted Kaplan Meier plots. I am calculating mortality comparing different exposures and I have a very specific problem: Is there a way to change the x axis labels of…
Pontus Hedberg
  • 301
  • 1
  • 2
  • 9
6
votes
1 answer

How to model interaction of covariate with time when proportionality assumption is violated in survival analysis in R

In R, what is the best way to incorporate the interaction term between a covariate and time, when the proportionality test (with coxph) shows that the proportionality assumption in the Cox model is violated? I know that you can either use strata or…
B.Z.
  • 61
  • 1
  • 6
5
votes
2 answers

survreg with left truncated (delayed entry) data

I am trying to fit a delayed entry parametric regression model for a Poisson process with Weibull baseline rate. It doesn't appear that R's survreg function supports left truncated data (I get the error: start-stop type Surv objects are not…
Jake
  • 510
  • 11
  • 19
5
votes
1 answer

Xgboost for survival using mlr in R

I would like to use mlr to run xgboost on right-censored survival data in R. The xgboost code lists an objective function survival:cox which says: survival:cox: Cox regression for right censored survival time data (negative values are considered…
panda
  • 821
  • 1
  • 9
  • 20
5
votes
2 answers

Plotting the Hazard Function in R using survminer?

We can use survminer to plot the survival function or cumulative hazard function, but I cannot see a way to use it to plot the hazard function. For example, library(survival) library(tidyverse) library(survminer) data(lung) # Run Kaplan-Meier on…
Lily Clements
  • 115
  • 1
  • 6
5
votes
3 answers

how to fix 'Error: variable lengths differ (found for 'input$s')' in R Shiny

I'm trying to make a simple shiny ap for creating kaplan-meier survival curves that are stratified by selection the user makes. When I code the KM calculation statically (with the column name thorTr) it works but the calculation and plot is static.…
R. Cantor
  • 61
  • 5
5
votes
0 answers

Time-Dependent Cox Model

Consider the attached (dummy) sample csv file where two methods (i.e. Method A and Method B) are used to evaluate time to progression (PFS) in cancer patients. For each patient we also have the overall survival (OS). data available as CSV from…
user86533
  • 323
  • 1
  • 7
  • 18
4
votes
1 answer

Why doesn't this survfit plot start at 100%

When I plot the survfit plot of data with two different censoring events, the overall plot (s0) doesnt start at time = 0, pstate = 100%, but jumps to 100% when the first cencoring event occurs. Here you can see in an example, where the jump occurs…
LittleLynx
  • 1,163
  • 2
  • 12
4
votes
2 answers

Does officer-package accept ggsurvplot-object?

I'm trying to export a ggsurvplot-object to powerpoint with officer-package with no success. I was able to find a lot of instructions on how to use now obsolute ReporterS-package for this and a few mentions that officer should work as well. There…
4
votes
1 answer

why do results of clogit and bife function (both in R) differ?

I like to calculate a logistic fixed effect panel regression (conditional maximum likelihood) in R and get predicted values and/or average marginal effects. I found two functions: bife and clogit from the survival packages Nevertheless, the…
k.r.
  • 41
  • 2
4
votes
3 answers

Computing SE or CI for ggadjustedcurves

How can I compute index of variability (SE or CI) for ggadjustedcurves from survminer function? I am using the conditional method. Anyone have any input or resource?
mindhabits
  • 421
  • 1
  • 3
  • 10
4
votes
2 answers

Nan and Inf in survreg model summary

I'm using survival analysis to evaluate the relative distance (instead of time, as it's usually the case with survival statistics) before a given event happened. As the dataset I'm working with is quite big, you can download the .rds file of my…
4
votes
1 answer

Xgboost cox survival time entry

In the new implementation of cox ph survival model in xgboost 0.81 how does one specify start and end time of an event? Thanks The R equivalent function would be for example : cph_mod = coxph(Surv(Start, Stop, Status) ~ Age + Sex + SBP, data=data)
aiedu
  • 133
  • 2
  • 11
4
votes
1 answer

cox model doesn't suppport "mright" survival data

Good morning, I have been trying to do a stratified logistic regression in R after matching for a Case/Control study and encountered a in my opinion unexpected mistake. I have reproduced the error using the mtcars data…
Member0815
  • 51
  • 1
  • 3
4
votes
1 answer

unable to plot kaplan-meier curve with survfit object from a list using ggsurvplot

I am trying to plot Kaplan-Meyer curve using ggsurvplot from survminer package. I'm unable to plot it when I pass a survfit object saved in a list. Let me use lung dataset as a example. Everything works…
zesla
  • 11,155
  • 16
  • 82
  • 147
1
2 3
29 30