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
2 answers

Cox proportional hazard model on (burn) data

On a study is described which evaluates a protocol change in disinfectant practices in a large midwestern university medical center. Of primary interest in the study is a comparison of two methods of body cleansing. The first method, used exclusively…
Dana
  • 75
  • 5
1
vote
0 answers

Is there a way to bound the variances estimates in the `coxme` R package?

I use the variance estimates obtained in a coxmeoutput for a further procedure: model = coxme(Surv(time, status) ~ (0 + A | B ) + (1| B ) + strata(A) , data) NUM = sum(unlist(model$vcoef)) However, I need the sum of the two variances estimates (NUM…
Flora Grappelli
  • 659
  • 9
  • 26
1
vote
1 answer

Calculating months of follow-up with pyears() of survival package

I want to calculate the person-time of follow-up by calendar month. In my example, I have three subjects, with different times of follow-up. I want to know if the rates of the event vary by year tertiles, so I want to sum up the time at risk they…
1
vote
1 answer

Create new columns in loop based on different datasets

Here's a brief description of the data I have: Survival data from 4 separate studies that compares the survival rates among 20 groups. Each study lasted a different amount of time. For example, study 1 lasted 42 days and Study 2 lasted 50 days. …
user2813606
  • 797
  • 2
  • 13
  • 37
1
vote
1 answer

Why is pval.size ignored by ggsurvplot_facet?

Why is pval.size ignored by ggsurvplot_facet()? I am trying to change the size of the p-value text in my survival plot using ggsurvplot_facet(), but the call to pval.size appears to be ignored. If anyone can help me change p-value size in my…
1
vote
1 answer

Error variable lengths differ ggsurvplot_facet

I am trying to run ggsurvplot_facet() but cannot get past Error in model.frame.default(formula = surv_object2 ~ id, data = list( :variable lengths differ (found for 'id'). Any help would be greatly appreciated. I believe the error is in the…
1
vote
2 answers

Predict event probability per factor with a coxph model

My question is a relatively simple one but I couldn't find any clear answer from the different forums. I am running a coxph model to predict the survival of individual plants that experienced two treatments in three different sites. The individuals…
1
vote
0 answers

Plot survival curves for regression employing tt and strata and frailty() - coxph in r

I have a Cox regression which employs strata() and a tt(). How can i plot this? All the usual suspects (ggsurvplot, hazard.ratio.plot) dont work for a coxph.penalformat. Here is some dummy data: set.seed(132456) 'dummy survival…
Juan
  • 171
  • 1
  • 12
1
vote
0 answers

Add stratification in surv.coxph for mlr library? (R)

I'm unable to add strata() anywhere in the formula when training a Cox regression using mlr's surv.coxph Here's a rough example using lung dataset from survival package. I've arbitrarily chosen sex variable as my stratification…
haosin
  • 11
  • 2
1
vote
1 answer

"object 'status' not found" error when using coxph in R

Whenever I get to the "coxph" function in my code it gives me the error "Error in Surv(time, status) : object 'status' not found". But I don't get that same error elsewhere. What can I do? This is my current…
Nonya
  • 115
  • 1
  • 5
1
vote
0 answers

Surv function input - right,left or interval censored? In R

I am at the beginning of setting up a survival analysis in R. I took a look in this book here: https://www.powells.com/book/modeling-survival-data-9780387987842/ but struggle to properly set the data up in the first place. So this is a very basic…
Juan
  • 171
  • 1
  • 12
1
vote
1 answer

Scoping with formulae in coxph objects

I'm trying to write a set of functions where the first function fits a cox model (via coxph in the survival package in R), and the second function gets estimated survival for a new dataset, given the fitted model object from the first function. I'm…
alex keil
  • 1,001
  • 7
  • 14
1
vote
1 answer

How to set data for R survival analysis

I'm sorry if the question looks silly, but I have a small data set which I would like to manipulate with function "survfit" of R package "survival", and, well, I don't know to set a proper dataframe usable by "survfit"; data are as follows: …
Andrew
  • 926
  • 2
  • 17
  • 24
1
vote
2 answers

survival::tmerge() giving as.Date.numeric(value) error

I'm trying to tmerge some data together to do some survival analysis, but I keep getting an error. library(survival) library(lubridate) df1 <- data.frame(id = "62103", hire.date = ymd("2016-05-16"), end.date =…
dyrland
  • 608
  • 1
  • 7
  • 17
1
vote
0 answers

How to calculate individual restricted mean survival time (RMST) in R?

I encountered some issues when calculating restricted mean survival time (RMST) in R and I made some attempts. Here is the idea that I tried to calculate the RMST by myself. i) I fitted a cox regression model to get estimated function of h(t), and I…
Sugus
  • 23
  • 4