DATA MINING
Desktop Survival Guide by Graham Williams |
|||||
Apply to New Data |
With an optional new dataset argument the predicted values for entities not in the original dataset can be obtained.
How does the mean thing apply to newdata:
> smpl <- sample(nrow(lung), 0.5*nrow(lung)) > l.coxph.smpl <- coxph(Surv(time, status) ~ age, data=lung[smpl,], method="breslow") > sum(predict(l.coxph.smpl, newdata=lung[-smpl,], type="lp")) |
[1] -1.170568 |