Closed rvlenth closed 3 years ago
This seems to be fixed in commit 46dc21c.
Thanks -- looks promising. I'll check it out soon.
Thanks. I have done some testing, in particular that it works correctly with emmeans; and all seems correct. Thanks again!
I have found that when an
mblogit
model contains scaled predictor(s), then subsequent predictions are incorrect. Here is an example comparing predictions from equivalent models usingnnet::multinom
andmclogit::mblogit
:Note that the predictions differ substantially. This is in part because the scaling information is not available. Normally, this information is in the
predvars
attribute of theterms
component:I tried tricking it into doing the right thing by copying this attribute from the other model. However, this does not change the predictions:
Created on 2021-02-16 by the reprex package (v0.3.0)
A few notes:
poly()
, where we need the transformation parameters based on the original data.$terms
component of the returned model is complete. Normally, it can be obtained as an attribute of the model matrix b) Thepredict.mblogit
method seems to build its model matrixX
from the model formula (In seerhs <- object$formula[-2]
in the code), rather than the$terms
component of the object.