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
-1
votes
1 answer
Improving survival curves
Could someone help me improve my below coding as I don't think that I am quite getting the answer to this question? It is based on an R database VA.
"using the td data frame below and ggplot, produce a single graphic that allows comparison of…

Dearbhla
- 1
- 1
-1
votes
2 answers
How to join two dataframes containing time varying variables in R
This seems like a simple enough thing but I can't figure it out nor find an answer online - apologies if it something obvious. I have two seperate dataframes containing the same patients with the same unique identifier. Both datasets have time…

Ryan
- 51
- 5
-1
votes
1 answer
coxph(surv) - how to obtain hazard ratio as a reciprocal
I have a dataset and need to compare survival between Treatment A and Treatment B using survminer.
I want treatment A to be my reference, but R automatically assigns the reference as treatment B and gives me the HR the wrong way (for treatment B but…

lovebead33
- 41
- 3
-1
votes
1 answer
How to calculate X-year survival probability from a cox regression of random survival forest in R
I want to build a survival model then calculate the X-year (e.g. 10-year) risk of survival.
Is there a way to do this using coxph or survreg? Is this possible using random survival forest (e.g. ranger)?
P.S. not sure if important but data is wide…

Adam Waring
- 1,158
- 8
- 20
-1
votes
1 answer
Convert numeric (days) to numeric (months) in R
How do I convert a list of survival times for patients in days to months in R? I would like to perform the survival analysis such as KM curve using months instead of days.
The raw dataset comes in days. For example, Patient 1 - 500, Patient 2 - 450,…

user2310
- 31
- 1
- 5
-1
votes
1 answer
simulation of a weibull duration model
I want to create an event variable that follows Weibull distribution. The important thing is that the variable should be a combination of a few other observed variables.
Eg: Death is the time to event variable follow Weibull distribution which I…

Aria
- 37
- 4
-1
votes
1 answer
Survminer, survival package: What is the difference between the "survdiff" log-rank and "regular" log-rank tests?
I am using the survminer survival package in R. To compute p values to compare survival curves, I am using the surf_pvalue function.
With this function, you can determine the log-rank p value in two different ways. One is called "survdiff", the…

Sylvia Rodriguez
- 1,203
- 2
- 11
- 30
-1
votes
1 answer
Trying to shift entries in a column
I am trying to move entries in my column around to set them up as start/stop times. The first row for each id is set up fine but I need to shift the rest down and over for this to work as I am trying.
I have tried using dplyr and mutating the…

CharlesI
- 3
- 1
-1
votes
1 answer
extract the coordinates of the points of a Survfit line
i hope the example will work.
i wanted to know if there is a way to extract the coordninates of EACH point od a survival curve.
i know from ?plot.survfit that it will produce a values with the coordinates of the end of each class, but i would…

xallalon
- 1
- 1
-2
votes
1 answer
Survival statistics in R
I have 100 repeats in 15 independent categories, each individual's survival is recorded at 5 different stages.
An example of the data is as follows:
Category Stage of death
1 3
1 2
1 …

Annabelle Ford
- 11
- 1