[R-sig-ME] Another predict/cloglog peculiarity --- lme4 this time.
Rolf Turner
r@turner @end|ng |rom @uck|@nd@@c@nz
Fri Apr 3 02:35:37 CEST 2020
I'm a bit hesitant to ask this, since the last time that I asked about a
peculiar result from predict and the "cloglog" link, it turned out that
the problem was due to my having installed an "unorthodox" version of
the glmmTMB package. So I had egg on my face.
This time the package involved is lme4 and I'm pretty sure that I am
using the "standard" version. (See my session info below.) If I am just
doing something stupid, I apologise for the noise.
Now to the question:
I'm pretty sure that
linkfun(predict(fit,type=response))
should be equal to predict(fit,type="link") and likewise
linkinv(predict(fit,type="link"))
should be equal to predict(fit,type="response")) .
With lme4, when the "logit" link is used, both of these equalities
appear to hold. When the "cloglog" link is used, the second equality
holds, but in first instance I get a range of differences:
> [1] -4.60471443 0.00281936
I have attached a sourceable script "demo.txt" and the data set "X.txt"
upon which it depends to demonstrate this phenomenon.
I'd appreciate any enlightenment that anyone can provide about what's
going on here. If I'm just being stupid, please feel free to tell me
so, as bluntly as you like.
My session info:
> R version 3.6.3 (2020-02-29)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.4 LTS
>
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
> LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
>
> locale:
> [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_NZ.UTF-8 LC_COLLATE=en_GB.UTF-8
> [5] LC_MONETARY=en_NZ.UTF-8 LC_MESSAGES=en_GB.UTF-8
> [7] LC_PAPER=en_NZ.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] lme4_1.1-21 Matrix_1.2-17 brev_0.0-3
>
> loaded via a namespace (and not attached):
> [1] minqa_1.2.4 MASS_7.3-51.5 compiler_3.6.3 Rcpp_1.0.4
> [5] splines_3.6.3 nlme_3.1-144 grid_3.6.3 nloptr_1.2.2.1
> [9] boot_1.3-24 lattice_0.20-40
Thanks.
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20200403/74294891/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: X.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20200403/74294891/attachment-0001.txt>
More information about the R-sig-mixed-models
mailing list