"Error in predict.coxph(f.ph.eha, newdata = mort, type = "lp") :  Data
is not the same size as it was in the original fit"

This error message was added in a recent update to predict.coxph.  If it
needs to reconstruct some aspects from the original fit, such as the X
matrix or strata vector, it makes sure that the data set is the same
size.  It was to stop
  fit <- coxph(Surv(......     , data=mydata)

   read in a new copy of mydata
  predict(fit) then gives wrong results

One solution is to use model=TRUE in the orignal coxph call, so that no
reconstruction is needed.  The lm() function made model=TRUE the default
at some point for this very reason, the original lm had model=FALSE to
save space.  Whether coxph should make the same change is open to
debate.

Terry Therneau

______________________________________________
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