how to model random effects AND overdispersion in GLM

Discuss statistics related things
Post Reply
onyaw
Posts: 1
Joined: Sat Jan 18, 2020 7:10 pm

how to model random effects AND overdispersion in GLM

Post by onyaw »

Dear Jamovi mavens,

I'm a new user and delighted that Jamovi exists. I loaded the gamlj module because I need to analyze overdispersed count data while also modeling random effects associated with a cluster variable ("ID" in my R example below), where "a" and "b" are two levels of a factor "name" and "counts" are the counts.

Among the tools I can see Poisson overdispersion can be modeled in the Generalized Linear Models interface, and random effects on a cluster variable can be modeled in Generalized Mixed Models, but I cannot see how to put them both in the same model.

If it helps, my R code for a simple model using the lme4 package looks something like below but I have others with multiple factors with multiple levels - love the jamovi interface for that.

Thanks,

onyaw


a<-1*(data$name=='A')
b<-1*(data$name=='B')
counts_d<-data$counts
rep_ind<-c(1:length(a))
ID_e<-(data$ID)

#FIT FULL MODEL WITH INTERACTION TERMS
fit_a<-glmer(counts_d~(1|rep_ind) +(1|ID_e) + b, family='poisson')

#FIT NULL MODEL
fit_a0<-glmer(counts_d~(1|rep_ind) +(1|ID_e), family='poisson')

lr_a<- as.numeric(-2*(logLik(fit_a0)-logLik(fit_a)))
p_a<-exp(pchisq(lr_a,1,lower.tail=F,log.p=T)) #P-VALUE FOR INTERACTION TEST
p_a
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: how to model random effects AND overdispersion in GLM

Post by mcfanda@gmail.com »

Hi, generalized mixed models are new in the gamlj menu, and for the moment mixed overdispersed logistic models are not implemented. You can run analyses implemented in your R code with gamlj, but not the overdispersion, yet. It's in the pipeline and it would come out soon
Post Reply