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 survreg, bj, coxph
functions.   Any help is greatly appreciated.

This is what I have so far:
survtime  <- 10*rexp(500)  #distribution of survival time
cens <- ifelse(survtime > 10, 0, 1) #indicator for censored/observed
survtime  <- pmin(survtime, 10) #new survival time values with censored
info
age <- rnorm(200, 40, 10)  #age variable
race <- factor(sample(c('a','b'),500,TRUE))  #categorical variable
test <- bj(Surv(survtime, cens) ~ rcs(age,5) + race)

        [[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.

Reply via email to