Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different estimates from glmer and pglmm #71

Open
heliconius-maps opened this issue Feb 12, 2022 · 1 comment
Open

different estimates from glmer and pglmm #71

heliconius-maps opened this issue Feb 12, 2022 · 1 comment

Comments

@heliconius-maps
Copy link

Hi,
I've noticed that I get different output from glmer and pglmm, when I think(?) the output should be more similar (example below). I imagine that I am specifying the models differently in some way, but it's not clear to me how. Could you possibly provide some guidance?
Thank you,
Neil

library(phyr)
library(lme4)

#some example data
s <- c(11, 12, 0, 1, 4, 4, 2, 3, 24, 14, 5, 6, 7, 15, 14, 9, 0, 0, 2, 11) # successes
f <- c(2, 2, 2, 2, 4, 6, 5, 3, 1, 1, 6, 3, 11, 3, 1, 0, 1, 5, 2, 3) # failures
ID<-c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U")

dat.long<-data.frame(s,f,ID)

#glmer
m1<-glmer(cbind(s,f) ~ 1 + (1|ID),data=dat.long,family="binomial")
#PGLMM
m2<-pglmm(cbind(s,f) ~ 1 + (1|ID),
data=dat.long,family="binomial", add.obs.re = FALSE,REML = FALSE)
summary(m1)
summary(m2)
logLik(m1)
m2$logLik

@daijiang
Copy link
Owner

Hi,
This is because lme4 and phyr used different approaches for glmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants