survival

Survdiff p-value comparison

和自甴很熟 提交于 2019-12-24 19:24:53
问题 I am trying to run a survival analysis on a set of data I have collected. In this data frame (m3), each row is a new patient and each column is a mutation I have identified. I have made a binary data table to indicate whether each patient is positive or negative for the mutation. I can run a survfit function for each column(mutation), but I have hundreds and want to loop through them. I have written the following code, but don't think it is correct (nothing is being output). for (i in m3[,2

MLR - Survival analysis with time-dependent data

独自空忆成欢 提交于 2019-12-24 14:35:05
问题 I am using mlr and would like to be able to use the extended version of the Cox PH model for right-censored, time dependent covariates. This is what I have tried, following the vignette on time-dependent covariates https://cran.microsoft.com/web/packages/survival/vignettes/timedep.pdf (section 3.4): library(survival) library(mlr) data(pbc) temp <- subset(pbc, id <= 312, select=c(id:sex, stage)) # baseline pbc2 <- tmerge(temp, temp, id=id, death = event(time, status)) #set range pbc2 <- tmerge

Survival analysis combining survfit and ggplot objects

穿精又带淫゛_ 提交于 2019-12-13 04:14:32
问题 A little background that might be useful. I am in a position that I have two plots that need to be combined. I have used the "survival" package to generate a Kaplan-Meier curve from a set of data. I have also created and used a custom function to generate survival curves (from the same data, after being processed by WinBUGS) I generate my K-M curve in the following way. library("survminer") library("survival") KM.est <- survfit(Surv(IPD.data[,1],IPD.data[,2])~1, data=IPD.data,type="kaplan

How to fit frailty survival models in R

帅比萌擦擦* 提交于 2019-12-07 20:25:27
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated last year . Because this is such a long question I've broken it down into 2 parts; the first being just the basic question and the second providing details of what I've attempted so far. Question - Short How do you fit an individual frailty survival model in R? In particular I am trying to re-create the coefficient estimates and SE's in the table below that were found from fitting the a semi

How to fit frailty survival models in R

℡╲_俬逩灬. 提交于 2019-12-06 06:07:19
This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated last year . Because this is such a long question I've broken it down into 2 parts; the first being just the basic question and the second providing details of what I've attempted so far. Question - Short How do you fit an individual frailty survival model in R? In particular I am trying to re-create the coefficient estimates and SE's in the table below that were found from fitting the a semi-parametric frailty model to this dataset link . The model takes the form: h_i(t) = z_i h_0(t) exp(

Overlay different ggplot2 objects

人走茶凉 提交于 2019-12-02 16:04:41
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated last year . I have previously tried to ask for help but did not actually solve my problem. More info can be found here: (you can find the data-set here) https://stackoverflow.com/questions/51442502/survival-analysis-combining-survfit-and-ggplot-objects Unfortunately I am unable to produce a solid example to post as my code is heavily based on external programs. I am positive though that my

Overlay different ggplot2 objects

不羁的心 提交于 2019-12-02 11:50:01
I have previously tried to ask for help but did not actually solve my problem. More info can be found here: (you can find the data-set here) https://stackoverflow.com/questions/51442502/survival-analysis-combining-survfit-and-ggplot-objects Unfortunately I am unable to produce a solid example to post as my code is heavily based on external programs. I am positive though that my question can be answered regardless. I reach a point where I create 2 ggplot2 objects that need to be combined to a single figure, one overlayed on top of the other. Namely, one km.plot which is of class: class(km.plot

Stratified log-rank test in R for counting process form data?

微笑、不失礼 提交于 2019-12-02 03:02:02
问题 Background : at half-year follow up times for 4y, patients may switch to a different medication group. To account for this, I've converted survival data into counting process form. I want to compare survival curves for medication groups A, B, and C. I am using an extended Cox model but want to do pairwise comparisons of each hazard function or do stratified log-rank tests. pairwise_survdiff throws an error because of the form of my data, I think. Example data : x<-data.frame(tstart=rep(seq(0

Stratified log-rank test in R for counting process form data?

北城余情 提交于 2019-12-02 02:32:51
Background : at half-year follow up times for 4y, patients may switch to a different medication group. To account for this, I've converted survival data into counting process form. I want to compare survival curves for medication groups A, B, and C. I am using an extended Cox model but want to do pairwise comparisons of each hazard function or do stratified log-rank tests. pairwise_survdiff throws an error because of the form of my data, I think. Example data : x<-data.frame(tstart=rep(seq(0,18,6),3),tstop=rep(seq(6,24,6),3), rx = rep(c("A","B","C"),4), death=c(rep(0,11),1)) x Problem : When