Re: [R] survival analysis simulation question

2012-05-10 Thread Joshua Wiley
I forgot to mention, the Design package is deprecated (which suggest your version of R is rather dated, current is 2.15). The rms package replaces Design. On Thu, May 10, 2012 at 10:23 PM, Joshua Wiley wrote: > Hi Grace, > > I seem to have sent an empty draft before.  Anyway, something like > th

Re: [R] survival analysis simulation question

2012-05-10 Thread Joshua Wiley
Hi Grace, I seem to have sent an empty draft before. Anyway, something like this might be an approach (untested): require(rms) set.seed(10) dat <- data.frame( age = rnorm(500, 40, 10), race = factor(sample.int(2,500,TRUE), labels = c("a", "b"))) X <- model.matrix(~ age + race, data = dat) b

Re: [R] survival analysis simulation question

2012-05-10 Thread Joshua Wiley
On Thu, May 10, 2012 at 7:41 PM, Grace Ma wrote: > Hi, > I am trying to simulate a regression on survival data under a few > conditions: > 1. Under different error distributions > 2. Have the error term be dependent on the covariates > > But I'm not sure how to specify either conditions. I am usin

[R] survival analysis simulation question

2012-05-10 Thread Grace Ma
Hi, I am trying to simulate a regression on survival data under a few conditions: 1. Under different error distributions 2. Have the error term be dependent on the covariates But I'm not sure how to specify either conditions. I am using the Design package to perform the survival analysis using the