[R] isssues with predict.coxph, offset, type = "expected", and newdata

David James daj025 at gmail.com
Mon Oct 3 04:40:41 CEST 2016

Thanks Terry,

Re: the second case (predicting from a null model with a newdata=
argument), I agree that it looks a bit over the top for such a
straight forward computation, so maybe it is more a wish than anything
else.  In this one instance, this computation is embedded in a wider
multi-state simulation in Epi::simLexis() where transition hazards are
modeled  as functions of covariates via Cox proportional hazards, and
a subset of transitions happen not to depend on any covariate, thus
the null model(s).   There are ways to circumvent this special case
within Epi::simLexis(), so even in this one example I wouldn't
consider it high priority at all.  But maybe it would be nice to have.

On Sat, Oct 1, 2016 at 10:44 PM, Therneau, Terry M., Ph.D.
<therneau at mayo.edu> wrote:
> I'm off on vacation and checking email only intermittently.
> Wrt the offset issue, I expect that you are correct.  This is not a case that I had ever envisioned, and so was not on my "list" when writing the code and certainly has no test case.  That does not mean that it shouldn't work, just that I am not shocked to see it.   I will look into this.
> For the second case of a NULL model I am less sympathetic.  This is, in theory, just reading off values from a Nelson hazard estimate at specific time points; using a coxph call to do so is a case of swatting a fly with a hammer.   A bit more background might make me more excited about extending the code to this case.
> Terry Therneau

More information about the R-help mailing list