Forum Replies Created

AuthorPosts

December 10, 2017 at 20:00 GMT+0000 in reply to: PB pvalues for a poisson glmm with an offset? #162CMacParticipant
Thanks Henrik. I will just be more patient then ðŸ™‚
I was just concerned because I am running some lmers on the same dataset (different response variables) with mixed using method=”PB” and they only take a few minutes to run, compared with the hours in which the glmer had not completed its calculations. The dataset is not that big, only 144 samples.Thank you very much for your help and explanations!
CMacParticipantWhoops, sorry, whilst creating the example data I identified the cause of the ‘type builtin not subsettable’ was related to my rookie mistake naming my dataframe ‘exp’ (doh!).
However things still don’t seem right: the mixed function now runs, but is taking an extremely long time to run compared with glmer, and hasn’t completed calculating Pvalues after several hours on my full dataset. It also produces a lot of nonconvergence warnings.
Here’s an example data subset and code. The mixed function does eventually complete calculations on this data, but still comes up with the nonconvergence warnings. It would be great if you could let me know if it’s working as expected or not. I hope I haven’t done anything else silly (I have checked everything I can think of). Thanks very much!!
#R version 3.4.3 (20171130)  "KiteEating Tree" #packages library(lme4) library(afex) #example data zz<"factor1 factor2 subject abundance max A a 1 659 658 A a 2 1408 1407 A b 1 826 789 A b 2 1348 1271 B a 3 242 242 B a 4 487 480 B b 3 605 585 B b 4 618 599 C a 5 382 346 C a 6 613 598 C b 5 370 336 C b 6 1002 963" df < read.table(text=zz, header = TRUE) #factors df$factor1<as.factor(df$factor1) df$factor2<as.factor(df$factor2) df$subject<as.factor(df$subject) #create index variable df$index<df$max/df$abundance #lme4::glmer mod1<glmer((index*abundance)~factor1*factor2+(1subject), data=df, family=poisson(link="log"), offset=(log(df$abundance))) #afex::mixed mod2<mixed((index*abundance)~factor1*factor2+(1subject), data=df, family=poisson(link="log"), offset=(log(df$abundance)), method="PB")
 This reply was modified 6 years, 5 months ago by henrik. Reason: nicer formatting of code

AuthorPosts