[R-sig-ME] predict.glmmTMB when "cloglog" link is used.

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Sun Mar 22 22:31:53 CET 2020


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.

cheers,

Rolf Turner

On 22/03/20 9:01 pm, Rolf Turner wrote:
> 
> Please consider the follow examples:
> 
> library(glmmTMB)
> X <- dget("demoDat.txt")
> fit1 <- glmmTMB(cbind(Dead,Alive) ~ (0+Trt)/Dose +
>                  (Dose|Rep),family=binomial(link="logit"),data=X)
> fit2 <- glmmTMB(cbind(Dead,Alive) ~ (0+Trt)/Dose +
>                  (Dose|Rep),family=binomial(link="cloglog"),data=X)
> 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 >   [1] 0.019609546 0.194977679 0.745729561 0.972612901 0.994688457 
> 0.998988370
>>   [7] 0.999807998 0.999963583 0.022220571 0.120654723 0.833383226 
>> 0.967947980
>>  [13] 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:
> 
>>> p2
>>   [1]  -3.244681e+00  -1.597702e+00  -3.235952e-01  -6.683303e-04  
>> -7.662901e-11
>>   [6]  -5.930060e-33 -2.134861e-103   0.000000e+00  -3.360384e+00  
>> -2.201879e+00
>>  [11]  -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.



More information about the R-sig-mixed-models mailing list