[R-sig-ME] predict.glmmTMB when "cloglog" link is used.
mo|||eebrook@ @end|ng |rom gm@||@com
Mon Mar 23 11:51:15 CET 2020
This sounds like a bug, but I can’t repeat the behavior. I get reasonable values in p2 and they look highly correlated to p1. Are you using the latest version from CRAN, 1.0.1? It should be essentially the same as the master branch on GitHub (only one vignette is behind). I can’t remember any recent changes (to either the CRAN or GitHub versions) that would make a difference, but updating is worth a try.
> On 22Mar 2020, at 22:31, Rolf Turner <r.turner using auckland.ac.nz> wrote:
> Further remarks:
> In an off-list message it was suggested to me that perhaps the value of p2 should be exponentiated. Indeed p1 and exp(p2) are "reasonably similar". I really don't understand how the necessity for exponentiation could arise, however.
> When the "probit" link is used to fit the model, predict.glmmTMB() seems to work just fine.
> I have stared a bit at the code for predict.glmmTMB() but the subtleties are too great for me to be able to figure out what is going on/wrong.
> Rolf Turner
> On 22/03/20 9:01 pm, Rolf Turner wrote:
>> Please consider the follow examples:
>> X <- dget("demoDat.txt")
>> fit1 <- glmmTMB(cbind(Dead,Alive) ~ (0+Trt)/Dose +
>> fit2 <- glmmTMB(cbind(Dead,Alive) ~ (0+Trt)/Dose +
>> p1 <- predict(fit1,type="response")
>> p2 <- predict(fit2,type="response")
>> The vector p1 appears to have "reasonable" entries i.e. they look (as they should) like probabilities:
>>>> p1 >  0.019609546 0.194977679 0.745729561 0.972612901 0.994688457
>>>  0.999807998 0.999963583 0.022220571 0.120654723 0.833383226 0.967947980
>>>  0.994545468 0.999092456 0.999975082 0.106684473 0.261453062 0.512048780
>> The entries of p2 do not seem "reasonable". In particular they all less than or equal to zero:
>>>  -3.244681e+00 -1.597702e+00 -3.235952e-01 -6.683303e-04 -7.662901e-11
>>>  -5.930060e-33 -2.134861e-103 0.000000e+00 -3.360384e+00 -2.201879e+00
>>>  -3.222809e-01 -1.400287e-02 -6.947338e-07 -3.769347e-21 -2.254755e-225
>> Am I misunderstanding something, or is there a bug in predict.glmmTMB? The data set in question is attached as "demoDat.txt".
>> Thanks for any enlightenment.
> R-sig-mixed-models using r-project.org mailing list
More information about the R-sig-mixed-models