similar to: Fitting and plotting a coxph with survfit, package(surv)

Displaying 20 results from an estimated 2000 matches similar to: "Fitting and plotting a coxph with survfit, package(surv)"

2012 Nov 06
3
Survplot, Y-axis in percent
Hi I am a new fan of R after getting mad with the graphical functional in SPSS. I have been able to create a nice looking Kaplan Meyer graph using Survplot function. However I have difficulties in turning the y axis to percent instead of the default 0-1 scale. Further I have tried the function yaxt="n" without any results. Any help in this matter will be appreciated. The code is
2009 May 10
2
plot(survfit(fitCox)) graph shows one line - should show two
R 2.8.1 Windows XP I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong? My code is reproduced below, my figure is attached to this EMail message. John > #Create simple survival object >
2006 May 19
2
Tick marks in lines.survfit
I posted several months about the problem with adding tick marks to curves using lines.survfit. This occurs when lines.survfit is used to add a curve to survival curves plotted with plot.survfit. The help for this function implies that mark.time=TRUE thus: plot(pfsfit,conf.int=FALSE,xscale=365.25,yscale=100,xlab="Years",ylab="% surviving",lty=2,mark=3)
2009 Mar 30
1
Possible bug in summary.survfit - 'scale' argument ignored?
Hi all, Using: R version 2.8.1 Patched (2009-03-07 r48068) on OSX (10.5.6) with survival version: Version: 2.35-3 Date: 2009-02-10 I get the following using the first example in ?summary.survfit: > summary( survfit( Surv(futime, fustat)~1, data=ovarian)) Call: survfit(formula = Surv(futime, fustat) ~ 1, data = ovarian) time n.risk n.event survival
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
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,fustat)~resid.ds+rx+ecog.ps,data=ovarian)
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 covariates in the new data frame? Thank you very much!
2005 Mar 17
1
Legend positioning in scaled survival plot
I am sorry that this is another novice question. I am having trouble using "legend" with the survival curve plot from the survival package, and I wonder if it is because I have rescaled my plot. Here is the relevant segment of code: > plot(survfit(Surv(OS,Status)~shortishcr1),main='Overall Survival by factor', + xlab='Years',ylab='%
2010 Jun 23
1
Probabilities from survfit.coxph:
Hello: In the example below (or for a censored data) using survfit.coxph, can anyone point me to a link or a pdf as to how the probabilities appearing in bold under "summary(pred$surv)" are calculated? Do these represent acumulative probability distribution in time (not including censored time)? Thanks very much, parmee *fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)*
2009 Feb 17
3
Survival-Analysis: How to get numerical values from survfit (and not just a plot)?
Hi! I came across 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
2006 Dec 21
1
: newbie estimating survival curve w/ survfit for coxph
I am wondering how to estimate the survival curve for a particular case(s) given a coxph model using this example code: #fit a cox proportional hazards model and plot the #predicted survival curve fit <- coxph( Surv(futime,fustat)~resid.ds+strata(rx)+ecog.ps+age,data=ovarian[1:23,]) z <- survfit(fit,newdata=ovarian[24:26,],individual=F) zs <- z$surv zt <-
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 printed by the summary.survfit function. Using the default confidence
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.95LCL 0.95UCL 203.0
2017 Oct 07
2
Adjusted survival curves
For adjusted survival curves I took the sample code from here: https://rpubs.com/daspringate/survival and adapted for my date, but got error. I would like to understand what is my mistake. Thanks! #ADAPTATION FOR MY DATA library(survival) library(survminer) df<-read.csv("F:/R/data/base.csv", header = TRUE, sep = ";") head(df) ID start stop censor sex age stage treatment 1
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
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 this correct?
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(surv.all)
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 =
2017 Oct 07
2
Adjusted survival curves
For adjusted survival curves I took the sample code from here: https://rpubs.com/daspringate/survival and adapted for my date, but ... have a QUESTION. library(survival) library(survminer) df<-read.csv("base.csv", header = TRUE, sep = ";") head(df) ID start stop censor sex age stage treatment 1 1 0 66 0 2 1 3 1 2 2 0 18 0 1 2 4 2 3 3 0 43 1 2 3 3 1 4 4 0 47 1 2 3 NA 2 5 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: