Displaying 20 results from an estimated 9000 matches similar to: "how to code the censor variable for "survfit""
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
#####################################
# CODE
# create
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 week
30, and no more people are censored in between. Is there a
2007 Oct 29
3
using survfit
hie
when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example
n=20
n1=n/2
n2=n/4
a11=4;a12=4 ;a21=4 ;a22=4
t1<-array(1,c(n1))
t2<-array(2,c(n1))
treatgrp=matrix(c(t1,t2))
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:
2009 Jul 22
1
kaplan-meier error
Hi all,
I am getting an error in my code and I don't know what the problem is.
I am using R 2.9 on ubuntu. my code is as follows:
## Libraries ##
library(survival)
library(foreign)
## reading data ##
data<-read.dta("http://psfaculty.ucdavis.edu/bsjjones/cabinet.dta")
head(data)
attach(data)
fit1<-survfit(Surv(durat,censor))
and I get the following error
>
2010 Jun 21
1
survfit function - event information???
Hi all!
I am trying to extract output information from the survfit function in order
to generate a matrix of select output for multiple factors.
Specifically, I am interested in extracting the number of events (in the
output below: 106, 2, 3). The variable names represented in my function
(ee) are shown below, but none of those variables correspond to the column
of events as shown in the output.
2011 Feb 17
1
censoring symbols on survfit plot
Hi, when ploting Kaplan-Meier estimate curves as below, the censoring symbols
(crosses) to not change thickness along the lines
plot(survfit(surv ~ I(x>=cut.off) ),lty=c(1,2), lwd=2)
is there any strightforward way to make it happen? thanks
robert
--
View this message in context: http://r.789695.n4.nabble.com/censoring-symbols-on-survfit-plot-tp3311283p3311283.html
Sent from the R help
2013 Nov 20
4
How to stop Kaplan-Meier curve at a time point
Hello R users
I have a question with Kaplan-Meier Curve with respect to my research. We
have done a retrospective study on fillings in the tooth and their survival
in relation to the many influencing factors. We had a long follow-up time
(upto 8yrs for some variables). However, we decided to stop the analysis at
the 6year follow up time, so that we can have uniform follow-up time for
all the
2005 Feb 04
2
no. at risk in survfit()
Hi,
when I generated a survfit() object, I can get number
of patients at risk at various time points by using
summary():
fit<-survfit(Surv(time,status)~class,data=mtdata)
summary(fit)
class=1
time n.risk n.event survival std.err lower 95% CI
upper 95% CI
9.9 78 1 0.987 0.0127 0.963 1
41.5 77 1 0.974 0.0179 0.940 1
54.0 76
2013 Oct 04
2
pregunta
En el libro EPICALC (pagina 229-230) en el que está el siguiente script,
todo nos funciona bien, pero cuando vamos a life table, ya allí no avanza,
lo señalamos en el script, por favor quizá se nos haya ido algún detalle,
pero fuimos siguiéndolo por el libro paso a paso y no no hemos percatado
Todos los de el paquete survival de la ayuda del R funcionan perfectamente
2002 Aug 02
1
survival analysis: plot.survfit
Hello everybody,
does anybody know how the function plot.survfit exactly works?
I'd like to plot the log of the cummulative hazard against the
log time by using plot.survfit(...fun="cloglog") which does not
work correctly. The scales are wrong and there is an error
message about infinit numbers. It must have something to do with
the censored data, doesn't it?
#Example:
2012 Sep 05
1
showing ticks for censored data in survfit() in the rms package
The answer to this may be obvious, but I was wondering in the rms
package and the survfit(), how you can plot the censored time points
as ticks.
Take for example,
library(survival)
library(rms)
foo <- data.frame(Time=c(1,2,3,4,5,6,10), Status=c(1,1,0,0,1,1,1))
answer <- survfit(Surv(foo$Time, foo$Status==1) ~1)
# this shows the censored time points as ticks at Time = 3 and 4
plot(answer)
2013 Oct 04
1
pregunta
Hola Jose, y podrias enviar algun link al libro o enviar esa parte
escaneada ?? para minimizar la posibilidad de que haya algo en la
transcripcion del script ...
Slds, eric.
On Fri 04 Oct 2013 01:59:33 PM CLT, daniel wrote:
> José,
>
> La función survfit espera como argumento una fórmula. Al pie del help de la
> función survfit dice:
>
> "Versiones anteriores del código
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 =
2002 May 02
2
plot survival points
Hi all,
I have a little problem.
I make an weibull survival analysis using the survival package. It,s OK, them
I have the functions. I plot this funcions with curve(). I want to make a
plot with the real survival points (proportion of alive x time) and them add
the curves to points. I have the time to dead, the censor data and my
trataments. To analysis the model is:
model1 <-
2012 Nov 17
4
survfit & number of variables != number of variable names
This works ok:
> cox = coxph(surv ~ bucket*(today + accor + both) + activity, data = data)
> fit = survfit(cox, newdata=data[1:100,])
but using strata leads to problems:
> cox.s = coxph(surv ~ bucket*(today + accor + both) + strata(activity),
> data = data)
> fit.s = survfit(cox.s, newdata=data[1:100,])
Error in model.frame.default(data = data[1:100, ], formula = ~bucket + :
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?
2011 Oct 17
3
Extracting results from a function output
Hello,
I am having hard time obtaining a value from a function. "fit" is a survival
function that produces some results, such as "median", "confidence
intervals" etc. But str() function does not list these values. How can I
extract these to be able use them? For example, I need "median" value for
the group DrugA which is 48. "Print" function does
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
2024 May 15
2
Extracting values from Surv function in survival package
OS X
R 4.3.3
Colleagues
I have created objects using the Surv function in the survival package:
> FIT.1
Call: survfit(formula = FORMULA1)
n events median 0.95LCL 0.95UCL
SUBDATA$ARM=1, SUBDATA[, EXP.STRAT]=0 18 13 345 156 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=1 13 5 NA 186 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=2 5