[R] predict witht he eha package
Terry Therneau
therneau at mayo.edu
Fri Jun 3 16:30:30 CEST 2011
"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
More information about the R-help
mailing list