search for: survdiff

Displaying 20 results from an estimated 62 matches for "survdiff".

2008 Dec 04
1
Comparing survival curves with "survdiff" "strata" help
ExpeRts, I'm trying to compare three survival curves using the function "survdiff" in the survival package. Following is my code and corresponding error message. > survdiff(Surv(st_months, status) ~ strata(BOR), data=mydata) Error in survdiff(Surv(st_months, status) ~ strata(BOR), data = mydata) : No groups to test When I check the "strata" of the variable....
2008 Feb 14
0
help in simplyfiying programme
...,time,censorTime) colnames(m)=c(“treat”,”strata”,”time”,”censorTime”) eventTime<-pmin(m[,"time"],m[,"censorTime"]) m<-cbind(m,eventTime) m<-cbind(m,0) m[m[,3]<m[,4],6]<-1 colnames(m)[6]<-"censoring" b=data.frame(m) c1= survdiff(Surv(eventTime,censoring)~treatgrp ,data=b,rho=-.15) c11= survdiff(Surv(eventTime)~treatgrp ,data=b,rho=-1.5) c2= survdiff(Surv(eventTime,censoring)~treatgrp ,data=b,rho=-1) c22= survdiff(Surv(eventTime)~treatgrp ,data=b,rho=-1) c3= survdiff(Surv(eventTime,censoring)~treatgrp ,data...
2012 Oct 19
2
Question about survdiff in for-loop.
Hi everyone!! I have dataset composed of a numbers of survival analyses. ( for batch survival analyses by using for-loop) . Here are code !! ####### dim(svsv) Num_t<-dim(svsv) Num<-Num_t[2] # These are predictors !! names=colnames(svsv) for (i in 1:Num ) { name_tt=names[i] survdiff(Surv(survival.m, survival) ~ names[i], data=svsv) fit.Group<-survfit(Surv(survival.m, survival) ~ names[i] , data=svsv) plot(fit.Group, col=2:1, xlab="Survival", ylab="Prob") } ##### names[i] is not working in the survdiff. According to help R , the predictor must be singl...
2007 Apr 26
2
Extract p-value from survdiff function
Hi list, I want to use the p-value from the survdiff function (package survival) to reuse within a function in a Kaplan-Meier plot. The p-value is somehow not a component of the value list ?! Thanks in advance -- A. Goralczyk G?ttingen, Ger.
2007 May 16
2
log rank test p value
How can I get the Log - Rank p value to be output? The chi square value can be output, so I was thinking if I can also have the degrees of freedom output I could generate the p value, but can't see how to find df either. > (survtest <- survdiff(Surv(time, cens) ~ group, data = surv,rho=0)) Call: survdiff(formula = Surv(time, cens) ~ group, data = surv, rho = 0) N Observed Expected (O-E)^2/E (O-E)^2/V group=1 20 16 11.0 2.23 4.64 group=2 20 12 17.0 1.45 4.64 Chisq= 4.6 on 1 degrees of fr...
2001 Nov 22
1
p-value using survdiff
Dear all, Does anyone knows how I could extract the p-value in: > survdiff(Surv(tempo,status) ~ grupo,data=dados1,rho=1) Call: survdiff(formula = Surv(tempo, status) ~ grupo, data = dados1, rho = 1) N Observed Expected (O-E)^2/E (O-E)^2/V grupo=1 21 5.12 12.00 3.94 14.5 grupo=2 21 14.55 7.68 6.16 14.5 Chisq= 14.5 on 1 degrees...
2012 Oct 18
1
looping survdiff?
Hello, I am trying to set up a loop that can run the survdiff function with the ultimate goal to generate a csv file with the p-values reported. However, whenever I try a loop I get an error such as "invalid type (list) for variable 'survival_data_variables[i]". This is a subset of my data: structure(list(time = c(1.51666666666667, 72, 72, 25...
2009 Sep 16
2
Teasing out logrank differences *between* groups using survdiff or something else?
...rvival analysis, but this is an area with which we are not very familiar, we just happen to have gathered some data that needs this type of analysis. We've done quite a bit of reading, but answers escape us, even though the question below seems simple. Considering the following example from ?survdiff: > survdiff(Surv(time, status) ~ pat.karno, data=lung) Call: survdiff(formula = Surv(time, status) ~ pat.karno, data = lung) n=225, 3 observations deleted due to missingness. N Observed Expected (O-E)^2/E (O-E)^2/V pat.karno=30 2 1 0.658 0.1774 0.179 pat.karn...
2010 Jul 07
1
Appropriateness of survdiff {survival} for non-censored data
...classical biological perspective. For example, for lifetable analysis of insects there is often no need to estimate survival using a Kaplan-Meir estimate because it is relatively easy to follow a cohort of individuals through the entire course of life. Thus I question the appropriateness of using survdiff in my analysis; I have exact data yet I would be testing on the Kaplan-Meir estimate of these data in survdiff. Thanks for any help.
2012 Oct 19
1
Looping survdiff
...makes me wonder if there's homework involved.... Simpler for your example is to use get and subset. dat <- structure(..... as found below var.to.test <- names(dat)[4:6] #variables of interest nvar <- length(var.to.test) chisq <- double(nvar) for (i in 1:nvar) { tfit <- survdiff(Surv(time, completion==2) ~ get(var.to.test[i]), data=dat, subset=(group==3)) chisq[i] <- tfit$chisq } write.csv(data.frame(var.to.test, chisq)) On 10/19/2012 05:00 AM, r-help-request at r-project.org wrote: > Hello, > > I am trying to set up a loop that can run the survdiff...
2007 Oct 19
0
calculating power of log rank test
...ames(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) c2= survdiff(Surv(act.surv.time,censoring)~treatgrp ,data=b,rho=-.15) c3= survdiff(Surv(act.surv.time,censoring)~treatgrp ,data=b,rho=-1) c4= survdiff(Surv(act.surv.time,censoring)~treatgrp ,data=b,rho=-0.5)...
2018 Feb 14
2
Fleming-Harrington weighted log rank test
Hi all,? The survdiff() from survival package has an argument "rho" that implements Fleming-Harrington weighted long rank test.? But according to several sources including "survminer" package (https://cran.r-project.org/web/packages/survminer/vignettes/Specifiying_weights_in_log-rank_comparisons.htm...
2005 Nov 23
1
survdiff for Left-truncated and right-censored data
dear all, I would like to know whether survdiff and survReg function in the survival package work for left-truncated and right-censored data. If not, what other functions can i use to make comparison between two survival curves with LTRC data. thanks for any help given sing yee
2004 Aug 17
1
survdiff
Hello, As I am quitte an ignorant user of R, excuse me for any wrongfull usage of all the terms. My question relates to the statistics behind the survdiff function in the package survival. My textbook knowledge of the logrank test tells me that if I want to compare two survival curves, I have to take the sum of the factors: (O-E)^2/E of both groups, which will give me the Chisq. If I calculate this by hand, I get a different value than the one R is g...
2012 Feb 23
2
Survival analysis and comparing survival curves
Hei, I have a one simple question which does not seem to be that simple as I cannot find any solution/answer: Is it possible to compare multiple survival curves in R with survdiff-function when there is interaction term involved in predictor variables (and this interaction is significant)? Example: survdiff(Surv(death,status)~treatment*gapsize) R is making "problems" with it ie.e. it does not want to perform the test. And all the examples I have found so far, ma...
2012 Jan 26
2
extracting from data.frames for survival analysis
...7 1 1 1 1 1 1 6.63 6.52 NA 0 6 27 1 1 23 4 1 2 1 1 1 1 7.19 6.51 NA 0 I am trying to perform survival analysis but continually get errors when extracting from this data.frame: attempt 1: > X <- Surv(B27.vec$AgeOn,B27.vec$UV) > survdiff(X,rho=0,data=uvf) Error in x$terms : $ operator is invalid for atomic vectors attempt 2: > X <- Surv(B27.vec[,4],B27.vec[,15]) > survdiff(X,rho=0,data=uvf) Error in x$terms : $ operator is invalid for atomic vector attempt 3: > AO <- B27.vec[["AgeOn", exact = TRUE]] >...
2018 Feb 15
0
Fleming-Harrington weighted log rank test
> On Feb 13, 2018, at 4:02 PM, array chip via R-help <r-help at r-project.org> wrote: > > Hi all, > > The survdiff() from survival package has an argument "rho" that implements Fleming-Harrington weighted long rank test. > > But according to several sources including "survminer" package (https://cran.r-project.org/web/packages/survminer/vignettes/Specifiying_weights_in_log-rank_compa...
2009 Aug 03
1
survdiff for left-truncated data?
Hi Does anyone know if there is a function like survdiff which can also handle left-truncated and right-censored data? When I use it on left-truncated and right-censored data I get an error message saying Right censored data only. Many thanks Rajen [[alternative HTML version deleted]]
2011 Jul 21
0
Survdiff for multiple comparisons
Hello all- I am doing a survival analysis for two species of invasive plants I outplanted to edges and interiors of island and mainland sites in a local reservoir. I am using the KM estimate and had no problem doing survdiff for my data using the following code: S4<-Surv(outplant$SurvTime, outplant$StatusD6) diff4=survdiff(S4 ~ outplant$Species+outplant$SiteType+outplant$EdgInt) diff4 Species = ALBIJU or LONIJA SiteType = Island or Mainland EdgInt = Edge or Interior The overall test for difference among the 8 cur...
2013 Apr 29
3
Comparing two different 'survival' events for the same subject using survdiff?
...nTx = B, TimeToFailure = C, NotFailed = D) We can do a survival analysis on those individually: OnTxFit = survfit (Surv ( TimeOnTx, StillOnTx==0 ) ~ 1 , data = myData) FailedFit = survfit (Surv ( TimeToFailure , NotFailed==0 ) ~ 1 , data = myData) plot(OnTxFit) lines(OnTxFit) But how can I do a survdiff type of comparison between the two? Do I have to restructure the data so that Time's are all in one column, Event in another and then a Group to indicate what type of event it is? Seems a complex way to do it (especially as the dataset is of course more complex than I've just shown)... so...