Hi,
Suppose I have:
# Fit a base model
d1.ph <- coxph(Surv(start, stop, event)~
ejec + diavol + score + smoking +
beta + surg.done,
data = data.frame(foo))
summary(update(d1.ph, . ~ . + td1))
summary(update(d1.ph, . ~ . + td2))
As I have many columns in my data frame, foo, called td's. e.g. td1, td2,
td3, .... And I'd like to add one column each time. What is the
recommended way to do this? Whether I should do what I did above, or
should I do something like:
td1.ph <- coxph(Surv(start, stop, event)~
ejec + diavol + score + smoking +
beta + surg.done + td1,
data = data.frame(foo))
td2.ph <- coxph(Surv(start, stop, event)~
ejec + diavol + score + smoking +
beta + surg.done + td2,
data = data.frame(foo))
I've done a system.time() on it and update() doesn't seem to be much (if
at all) faster. Is there an advantage of using update() then (other than
that the codes look neater)?
--
Cheers,
Kevin
--------------------------------------------------------------------------