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

Performing Pairwise test and test for survival trend

I am trying to perform pairwise tests to determine if there is any difference in survival between pairs of groups. the data used: time_Untreated<- c(20, 21, 23, 24, 24, 26, 26, 27, 28, 30) censor_Untreated<- c(rep(1,10),…
Heidi
  • 25
  • 5
0
votes
1 answer

tcut behavior with pyears when using start/stop times instead of follow-up time

I'm trying to use pyears to estimate incidence in a cohort where one of my covariates of interest is age at time of event (rather than age at enrolment, i.e. enrolment cohort). Age at event is of course time-dependent. The correct way to do this…
Peter Young
  • 131
  • 3
0
votes
1 answer

Calculate expected number of survivors over time with a known death rate

With a total number of N, a daily death rate: p1. I would like to calculate the number of survivors after certain days. day1 : N - N*p1 day2 : (N - N*p1) - (N - N*p1)*p1 day3 : ((N - N*p1) - (N - N*p1)*p1) - ((N - N*p1) - (N -…
Zhiqiang Wang
  • 6,206
  • 2
  • 13
  • 27
0
votes
1 answer

How to calculate restricted mean survival time for covariates in R?

I am trying to calculate the restricted mean survival time grouped by the covariates but I get an error. Could you please have a look at the code example code below and let me know what the problem is? library(survival) library(flexsurv) data <-…
gibsonmate
  • 25
  • 4
0
votes
1 answer

Number at risk for cox regression plot

can I make "number at risk "table for cox plot if I have more than one independent variable? if it possible where can I find the relevant code (I searched but couldn't find) the code I used on my data: fit <- coxph(Surv(time,event)…
0
votes
2 answers

convert event dates to time-event columns for survival analysis

I am trying to convert a list of observation for censored data to a proper format for survival analysis in R. To give an exemple, the code should transform like this. event.6mo event.12mo event.24mo 1 0 0 0 2 0 …
0
votes
0 answers

Kaplan Meier curve with very few events in R

I'd like to plot a KM curve, but have very few events in the data set.This gives for a strange plot and i am wondering if it is possible to set the limits on the y-axis, highlighting the differences better. Here is the dummy…
Juan
  • 171
  • 1
  • 12
0
votes
1 answer

Why am I getting an upward survival curve (cumulative incidence)?

I don't know how, but the survival curve that should be descending is coming out upwards. Actually I'm getting the cumulative incidence curve. Any ideas on how to find and fix the problem? Thank you! the "upwards" survival curve A piece of the…
lemosl
  • 5
  • 4
0
votes
1 answer

“non-numeric argument to binary operator” when using ggsurvplot() + geom_dl()

I would like to attach labels using geom_dl to a Kaplan–Meier (KM) plot produced by ggsurvplot. It works fine if I use the plot part of ggsurvplot. library(survival) library(survminer) library(directlabels) fit <- survfit(Surv(time, status) ~…
A. Suliman
  • 12,923
  • 5
  • 24
  • 37
0
votes
1 answer

Warning: 'newdata' has x rows but variables found have >x rows with coxph and survfit

I have reviewed the other similar questions and I don't believe I have found the answers. I am trying to do Cox regression with two co-variates - sex and disease status. Original data frame looks a bit like this: Patient ID: 1001, 1002 Age: 56,…
Meercat
  • 1
  • 2
0
votes
1 answer

Plot "extended" predicted survival on top of KM ggsurvplot

I would like to have those two plots gathered on one single plot. This would allow me to check how survival evolve on the long run while visually assessing the goodness of fit of the distribution. Can you help…
0
votes
0 answers

how to do gene mutation multivariate survival analysis in R?

I've been working on gene mutation survival analysis, the data downloaded&merged from TCGA somatic mutation file (MAF) is: barcode stage_group gender fustat futime SRCAP ZFHX4 AMER1 PCDHB8 AHNAK2 1 TCGA-CA-6719 StageI-II MALE …
Roy
  • 11
  • 2
0
votes
1 answer

Why do I get an error in ANOVA test on cox models in R?

I want to make a likelihood ratio test between two models in R. The 2 models are nested I removed all the missing item, creating a clean dataframe. Even though, when I do anova(mod2,mod3) I get this error message : Error in…
Flora Grappelli
  • 659
  • 9
  • 26
0
votes
1 answer

Extracting baseline hazards from stpm2-object

I need to extract the baseline hazards from a general survival model (GSM) that I've constructed using the rstpm2-package (a conversion of the stpm2 module in stata). using the data in the rstpm2-package let's use this as an…
Jarn Schöber
  • 309
  • 1
  • 8
0
votes
1 answer

How do I apply survival analysis in R to a new dataset?

The code is lifted directly from Data Camp's Marketing Analytics in R module, and applied to a new customer data, but I am stuck with what to do with the results after you apply the model to a new data set. I have the cox ph model with constant…
J F
  • 11
  • 2