-- begin included message ---
We occasionally utilize the coxph function in the survival library to
fit multinomial logit models. (The breslow method produces the same
likelihood function as the multinomial logit). We then utilize the
predict function to create summary results for various combinations of
covariates.  For example:

...

The problem is that under R 2.8.1 and R 2.9.1 the previous line fails
with the following error:

> totalut<-predict(mod1,newdata=newdata,type="lp")
Error in model.frame.default(Terms2, newdata, xlev = object$xlevels) :
  variable lengths differ (found for 'Price')
In addition: Warning message:
'newdata' had 25 rows but variable(s) found have 43350 rows

-----------end inclusion --------------


 The coxph code was updated to use the "standard" R methods for
prediction with factors.  I even added test cases -- but obviously I've
missed something.  I'll look into a fix and get back to you.  
  Can I assume that Price and Product were both factors with the 5
levels 1:5?

        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