search for: surv

Displaying 20 results from an estimated 1072 matches for "surv".

Did you mean: sure
2006 Mar 15
5
Surv object in data.frame
Dear All, a Surv object I put in a data frame behaves somehow unexpected (see example). If I do a Cox regression on the original Surv object it works. If I put it in a data.frame and do the regression on the data frame it does not work. Seemingly it has to do with the class attribute, because if I change the class...
2013 Jan 14
1
Does psm::Surv handle interval2 data?
Does Surv in psm handle interval2 data? The argument list seems to indicate it does but I get an error. Thanks, Chris # code library('survival') left <- c(1, 3, 5, NA) right <-c(2, 3, NA, 4) Surv(left, right, type='interval2') survreg(Surv(left, right, type='interval2') ~ 1)...
2011 Jun 24
1
UnoC function in survAUC for censoring-adjusted C-index
Hello, I am having some trouble with the 'censoring-adjusted C-index' by Uno et al, in the package survAUC. The relevant function is UnoC. The question has to do with what happens when I specify a time point t for the upper limit of the time range under consideration (we want to avoid using the right-end tail of the KM curve). Copying from the example in the help file: TR <- ovarian[1:16,] TE &l...
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) pl...
2009 Apr 25
3
Nomogram with stratified cph in Design package
...I will need to stratify to meet PH assumptions. This is where I go wrong, but I'm not sure where. Non-Stratified Nomogram: f<-cph(S~A+B+C+D+E+F+H,x=T,y=T,surv=T,time.inc=10*12,method="breslow") srv=Survival(f) srv120=function(lp) srv(10*12,lp) quant=Quantile(f) med=function(lp) quant(.5,lp) at.surv=c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9) at.med=c(120,80,60,40,30,20,15,10,8,6,4,2,0) nomogram(f,lp=F, fun=list(srv120, med),funlabel=c("120-mo S...
2005 Oct 11
1
summary of Surv object crashes R 2.2.0 (PR#8203)
Full_Name: Victor Moreno Version: 2.2.0 OS: windows Submission from: (NULL) (213.151.99.160) summary of an object class Surv (package survival) hangs and closes R 2.2.0 I would like to have Surv objects in a data frame to build models easier: t<-rexp(100) s<-rbinom(100,1,.3) surv<-Surv(t,s) x1<-rnorm(100,10,2) x2<-rnorm(100,10,2) dat<-data.frame(surv,x1,x2) coxph(surv~.,data=dat) so far no problems,...
2007 Oct 19
0
calculating power of log rank test
...weibull(n2,a21,1)) time22=array(rweibull(n2,a22,1)) time=matrix(c(time11, time12, time21, time22)) censorTime=runif(n,0,1) m=cbind(treatgrp,strata,time,censorTime) colnames(m)=c(?treat?,?strata?,?time?,?censorTime?) act.surv.time<-pmin(m[,"time"],m[,"censorTime"]) m<-cbind(m,act.surv.time) m<-cbind(m,0) m[m[,3]>m[,4],6]<-1 colnames(m)[6]<-"censoring" c1= survdiff(Surv(act.surv.time,censoring)~treatgrp ,data=b,rho=-2)...
2007 May 02
3
the Surv function
Hi, I'm trying to do a simple survival analysis on some data, and I'm having the following problem (here's my code and the error message): out <- Surv(fup,event=status) Error in Surv(fup, event = status) : argument "time2" is missing, with no default >From reading the documentation, it seems that I should b...
2009 Jul 13
1
survSplit with data.frame containing a Surv object
Dear All, since years I am struggling with Surv objects in data.frames. The following seems to have to do with it. See below the modified example from the help page of survSplit. The original works, as expected. If, however, a Surv object is added to the data.frame, each record gets doubled. Is there some solution other than avoiding Surv obj...
2012 Dec 06
1
as.matrix.Surv -- R core question/opinions
1. A Surv object is a matrix with some extra attributes. The as.matrix.Surv function removes the extras but otherwise leaves it as is. 2. The last several versions of the survival library were accidentally missing the S3method('as.matrix', 'Surv') line from their NAMESPACE file. (Instead...
2004 Aug 11
2
str and Surv objects
Dear R People: I used the "Surv" function to produce the following object: >a <- Surv(1:4,2:5,c(0,1,1,0)) a [1] (1,2+] (2,3 ] (3,4 ] (4,5+] >str(a) Error in "[.Surv"(object, 1:ile) : subscript out of bounds > Why does str(a) give an error, please? Or did I do something wrong? Thanks in advance. R Ver...
2009 May 15
1
Function Surv and interpretation
Dear everyone, My question involves the use of the survival object. We can have Surv(time,time2,event, type=, origin = 0) (1) As detailed on p.65 of: http://cran.r-project.org/web/packages/survival/survival.pdf My data (used in my study) is 'right censored' i.e. my variable corresponding to 'event' indicates whether a person...
2006 Mar 16
2
Surv object in data.frame and Design package
Dear All, there seems to be some strange influence of the Design package on data.frame. If I build a data.frame containing a Surv object without loading the package Design, the data frame is usable to coxph. If instead I just load Design and build a data.frame afterwards, the naming of the Surv object is different and it does not work with coxph. (In my real application I loaded Design to use the ie.setup function.) Even if I...
2004 Jun 07
1
Censboot Warning and Error Messages
...t;Loglik converged before variable..." message appears (please see printout below) while doing ordinary bootstrap, does it mean that I cannot trust the result of the bootstrap statistics? Is there a valid way to resolve it like increase the sample size? 2. In doing conditional bootstrap with survival data, how can one handle a data with two largest survival time observations (ties) but one is censored while the other is not. For example, if the censoring time is 48 months and a patient died exactly at that time, he will have the same survival time as another patient who was also observed t...
2009 Nov 06
1
Survival Plot in R 2.10.0
I would like to produce a complimentary log-log survival plot with only the points appearing on the graph. I am using the code below, taken from the plot.survfit page of help for the the survival package (version 2.35-7). I am running in R 2.10.0 on Windows XP, and the list of packages following the error is loaded. Is there some specific 'typ...
2008 Feb 14
0
help in simplyfiying programme
my program given below can some one make it presentable. I trying to simulate survival data and calculate the power. I think i could have done better. s=10 number=0 count1=0;count2=0;count3=0;count4=0;count5=0;count6=0;count7=0;count8=0; count9=0; count11=0;count22=0;count33=0;count44=0;count55=0;count66=0;count77=0; count88=0;count99=0; while(s!=0){ n=100...
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(...
2011 Sep 12
1
coxreg vs coxph: time-dependent treatment
Dear List, After including cluster() option the coxreg (from eha package) produces results slightly different than that of coxph (from survival) in the following time-dependent treatment effect calculation (example is used just to make the point). Will appreciate any explaination / comment. cheers, Ehsan ############################ require(survival) require(eha) data(heart) # create weights follow <- heart$stop - heart$start f...
2009 Jan 14
2
Kaplan-Meier Plot
dear all, I want to plot a kaplan Meier plot with the following functions, but I fail to produce the plot I want: library(survival) tim <- (1:50)/6 ind <- runif(50) ind[ind > 0.5] <- 1; ind[ind < 0.5] <- 0; MS <- runif(50) pred <- vector() pred[MS < 0.3] <- 0; pred[MS >= 0.3] <- 1 df <- as.data.frame(cbind(MS, tim, pred, ind)) names(df) <- c("MS", "time", "...
2007 Jan 19
1
Error in basehaz function ?
Hello R-users. I believe that the way basehaz (in the survival package) compute the baseline hazard function is false. I come to question this function when it gives me hazard probabilities greater than 1. Looking at the code I think I've localised the error : hazard probability is computed as : H <- -log(surv) but it seems to me that hazard p...