Closed jmpsteen closed 8 years ago
Patched by replacing predict
by predictFUN
in functions neImpute.default
, neWeight.default
and medflex:::neModelEst
and defining predictFUN
according to the class
of the fit
object, as below:
predictFUN <- if (inherits(fit, "vglm"))
VGAM::predictvglm
else if (inherits(fit, "vgam"))
VGAM::predict.vgam
else predict
Dispatching
predict
forvglm
fits (VGAM package) no longer works appropriately since the functionpredict.vglm
is replaced bypredictvglm
. It still works forvgam
fits though.Because of this, the example below
returns the error
Thanks to Theis Lange for bringing this up.
Similarly,
expData1
andexpData2
in the code below should have the same regression weights.Because of the same reason the first code returns an error, the weights are not the same.
In addition,
expData1
,expData2
andexpData3
in the code below should be the same. However, because of incorrect dispatching, when usingvglm
, predictions on the logit instead of probability scale are returned.Finally,
neMod1
andneMod2
should have the same coefficients. Because of incorrect dispatching inmedflex:::neModelEst
, the wrong weights are used forneMod2
(cf previous example).