Hi, You can use the par function to set the parameters of the plot to have multiple plots in one output. Have something like par(mfrow=c(2,1)) before your plot commands.
You could also write the the outputs to a ps, pdf or jpeg file (look for the pdf, postscript and jpeg commands). That way the plots would not be overwritten. Ritwik On 10/29/07, raymond chiruka <[EMAIL PROTECTED]> wrote: > > 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)) > st11<-array(1,c(n2)) > st12<-array(2,c(n2)) > st21<-array(1,c(n2)) > st22<-array(2,c(n2)) > strata=matrix(c(st11,st12,st21,st22)) > time11=array(rweibull(n2,a11,1)) > time12=array(rweibull(n2,a11,1)) > time21=array(rweibull(n2,a21,1)) > time22=array(rweibull(n2,a22,1)) > time=matrix(c(time11, time12, time21, time22)) > censorTime=runif(n,0,3) > 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" > m > b=data.frame(m) > > d2=survfit(Surv(act.surv.time > ,censoring)~treatgrp,data=b,type=c("fleming-harrington"), > > ) > > plot(d2, lty=2:3, fun="cumhaz", > > xlab="Months", ylab="Cumulative Hazard") > > d1=survfit(Surv(act.surv.time,censoring)~treatgrp,data=b,) > > plot(d1, lty=2:3, > > xlab="Months", ylab="survival curves") > > I only see the plot of d1 what happens to d2 and how do l view it. > thanks > > > > > __________________________________________________ > > > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > -- Ritwik Sinha [EMAIL PROTECTED] | +12033042111 | http://darwin.cwru.edu/~rsinha [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.