Re: [R] plot(survfit(fitCox)) graph shows one line - should show two

2009-05-10 Thread Finak Greg
I did not see an attached figure to compare against, perhaps it was removed by the server. I suspect that: plot(survfit(fit0,newdata=GVHDdata) will produce the plot you're looking for. It will generate survival curves for the data in GVHDdata using the estimates from the fit0 coxph model. At

Re: [R] Generating a "conditional time" variable

2009-05-09 Thread Finak Greg
That will teach me to post without a double-check. On 09/05/09 3:11 PM, "Finak Greg" wrote: Assuming the year column has complete data and doesn't skip a year, the following should take care of 1) #Simulated data frame: year from 1990 to 2003, for 5 different ids, each having

Re: [R] Generating a "conditional time" variable

2009-05-09 Thread Finak Greg
Assuming the year column has complete data and doesn't skip a year, the following should take care of 1) #Simulated data frame: year from 1990 to 2003, for 5 different ids, each having one or two eif "events" test<-data.frame(year=rep(1990:2003,5),id=gl(5,length(1990:2003)),eif=as.vector(sapply(