search for: survfit

Displaying 20 results from an estimated 401 matches for "survfit".

2012 Jul 06
1
How to compute hazard function using coxph.object
...#### Method - 1 # Coxph Model ## MODEL.COXPH <- coxph(Surv(time,status) ~ X1+X2 , data = MyData) ########################################################################################## ########################################################################################## # Survfit for the coxph object ## MODEL.COXPH.SURVFIT <- survfit(MODEL.COXPH) # Obtaining the object "surv" from the survfit object MODEL.COXPH.SURVFIT.SURV <- MODEL.COXPH.SURVFIT$surv # Computing the hazard function ## ## I am pretty confuse in this; whether result from this,...
2010 Jul 15
1
Standard Error for individual patient survival with survfit and summary.survfit
I am using the coxph, survfit and summary.survfit functions to calculate an estimate of predicted survival with confidence interval for future patients based on the survival distribution of an existing cohort of subjects. I am trying to understand the calculation and interpretation of the std.err and confidence intervals print...
2013 Mar 04
2
survfit plot question
Hello, I create a plot from a coxph object called fit.ads4: plot(survfit(fit.ads4)) plot is located at: https://www.dropbox.com/s/9jswrzid7mp1u62/survfit%20plot.png I also create the following survfit statistics: > print(survfit(fit.ads4),print.rmean=T) Call: survfit(formula = fit.ads4) records n.max n.start events *rmean *se(rmean) median 0...
2007 Dec 09
2
Getting estimates from survfit.coxph
Dear all, I'm having difficulty getting access to data generated by survfit and print.survfit when they are using with a Cox model (survfit.coxph). I would like to programmatically access the median survival time for each strata together with the 95% confidence interval. I can get it on screen, but can't get to it algorithmically. I found myself examining the source o...
2013 Jun 25
1
censor=FALSE and id options in survfit.coxph
Terry, I recently noticed the censor argument of survfit. For some analyses it greatly reduces the size of the resulting object, which is a nice feature. However, when combined with the id argument, only 1 prediction is made. Predictions can be made individually but I'd prefer to do them all at once if that change can be made. Chris ##########...
2009 Feb 25
3
survival::survfit,plot.survfit
I am confused when trying the function survfit. my question is: what does the survival curve given by plot.survfit mean? is it the survival curve with different covariates at different points? or just the baseline survival curve? for example, I run the following code and get the survival curve #### library(survival) fit<-coxph(Surv(futime...
2007 Apr 29
2
how to code the censor variable for "survfit"
...survival analysis. Currently, I have a data set which contains two variables, the variable of time to event (or time to censoring) and the variable of censor indicator. For the indicator variable, it was coded as 0 and 1. 0 represents right censor, 1 means event of interest. Now I try to use "survfit" in the package of "survival". I wrote the following code: > rptsurv <- survfit(surv(time,censor)~1,data=x) Before I run the code, I am concerned with my 0/1 coding to the censor indicator because I did not see any argument in the syntax of "survfit", which may tell...
2009 Jul 15
2
Substituting a user-defined function for a standard function in graphics
...I'm trying to substitute my own version of plot.default, in order to capture low-level graphics input for further manipulation. I seem to be having difficulties getting the versions of functions that I intend to use called at the right places. Specifically, I have an object produced by survfit from the survival package, and I want to save the values that plot.survfit would normally send to plot.default from the graphics package. I've tried the following: 1. I put my version of plot.default into .GlobalEnv. This works, in the sense of running without an error, but doesn't do wh...
2006 Oct 25
1
Incorrect 'n' returned by survfit()
I've a data set with 60000 rows of data representing 6000+ distinct loans. I did a coxph() regression on it (see call below), but a subsequent survfit() call on the coxph object is almost certainly wrong. It gives n=6 when it should be more like 6000+ (I think) > survfit(resultag) Call: survfit.coxph(object = resultag) n events median 0.95LCL 0.95UCL 6 489 Inf 2 Inf When I reduced the dataset to just 1000...
2014 Mar 06
1
Survfit Error
Hi everyone, I am not new to R, but new to running survival models in R. I am trying to create some basic KM curves, using the following code: library(survival) library(KMsurv) (import data etc - basic right censored, with continuously observed time of death) sleepfit <- survfit(Surv(timeb, death), data = sleep) Here timeb is measured is survival in years, death is a 1/0 indicator (1 = event = death), and the dataset is called sleep. But I get the following error Error in UseMethod("survfit", formula) : no applicable method for 'survfit' applied to...
2011 Oct 01
4
Is the output of survfit.coxph survival or baseline survival?
Dear all, I am confused with the output of survfit.coxph. Someone said that the survival given by summary(survfit.coxph) is the baseline survival S_0, but some said that is the survival S=S_0^exp{beta*x}. Which one is correct? By the way, if I use "newdata=" in the survfit, does that mean the survival is estimated by the value of covari...
2009 Feb 17
3
Survival-Analysis: How to get numerical values from survfit (and not just a plot)?
...ss R just a few days ago since I was looking for a toolbox for cox-regression. I?ve read "Cox Proportional-Hazards Regression for Survival Data Appendix to An R and S-PLUS Companion to Applied Regression" from John Fox. As described therein plotting survival-functions works well (plot(survfit(model))). But I?d like to do some manipulation with the survival-functions before plotting them e.g. dividing one survival-function by another. survfit() only returns an object of the following structure n events median 0.9LCL 0.9UCL 55.000 55.000 1.033 0.696 1.637 Can you tell me how...
2010 Aug 31
1
Speeding up prediction of survival estimates when using `survifit'
Hi, I fit a Cox PH model to estimate the cause-specific hazards (in a competing risks setting). Then , I compute the survival estimates for all the individuals in my data set using the `survfit' function. I am currently playing with a data set that has about 6000 observations and 12 covariates. I am finding that the survfit function is very slow. Here is a simple simulation example (modified from Frank Harrell's example for `cph') that illustrates the problem: #n <- 5...
2010 Apr 19
2
Kaplan-Meier survfit problem
When I try to the code from library(survival) of library(ISwR), the following code survfit(Surv(days,status==1)) that could produce Kaplan-Meier estimates shows the following error "Error in survfit(Surv(days, status == 1)) : Survfit requires a formula or a coxph fit as the first argument" How it can be done in R.2.10 -- View this message in context: http://n4.nabble.com...
2011 Mar 18
1
median survival time from survfit
Hello, I am trying to compute the mdeian of the survival time from the function survfit: > fit <- survfit(Surv(time, status) ~ 1) > fit Call: survfit(formula = Surv(time, status) ~ 1) records n.max n.start events median 0.95LCL 0.95UCL 111 111 111 20 NA NA NA The results is NA? the fit$surv gives values between 1 and 0.749! Am I doing th...
2010 Sep 10
2
survfit question
Hi, I am attempting to graph a Kaplan Meier estimate for some claims using the survfit function. However, I was wondering if it is possible to plot a cdf of the kaplan meier rather than the survival function. Here is some of my code: library(survival) Surv(claimj,censorj==0) survfit(Surv(claimj,censorj==0)~1) surv.all<-survfit(Surv(claimj,censorj==0)~1) summary(surv.all) plot(...
2005 Sep 19
2
Problem with tick marks in lines.survfit (package survival)
I have attempted to follow posting guidelines but I have failed to find out what I am doing wrong here. I am trying to use lines.survfit to plot a second curve onto a survival curve produced by plot.survfit. In my case this is to be a progression free survival curve superimposed upon an overall survival curve, but I will illustrate my problem using the example given in the help for lines.survfit. I would like to have tick marks...
2013 Mar 14
1
cnfidence intervals for survfit()
Hi, I am wondering how the confidence interval for Kaplan-Meier estimator is calculated by survfit(). For example,  > summary(survfit(Surv(time,status)~1,data),times=10) Call: survfit(formula = Surv(rtime10, rstat10) ~ 1, data = mgi)  time n.risk n.event survival std.err lower 95% CI upper 95% CI    10    168      55    0.761  0.0282        0.707        0.818 I am trying to reproduce the...
2009 Sep 08
1
Obtaining value of median survival for survfit function to use in calculation
Hi, I'm sure this should be simple but I can't figure it out! I want to get the median survival calculated by the survfit function and use the value rather than just be able to print it. Something like this: library(survival) data(lung) lung.byPS = survfit(Surv (time, status) ~ ph.ecog, data=lung) # lung.byPS Call: survfit(formula = Surv(time, status) ~ ph.ecog, data = lung) 1 observation deleted due to missingn...
2010 Sep 23
2
extending survival curves past the last event using plot.survfit
Hello, I'm using plot.survfit to plot cumulative incidence of an event. Essentially, my code boils down to: cox <-coxph(Surv(EVINF,STATUS) ~ strata(TREAT) + covariates, data=dat) surv <- survfit(cox) plot(surv,mark.time=F,fun="event") Follow-up time extends to 54 weeks, but the last event occurs at wee...