Karina Charest Castro <jlonkc <at> gmail.com> writes: > > Hi!
This question is more appropriate for r-sig-mixed-mod...@r-project.org. Please repost there (I will add a few questions/comments below that you should probably address when you repost) > I am trying to do a glmer.nb but get this error: > Error in eval(expr, envir, enclos) : > ..2 used in an incorrect context, no ... to look in > > My data structure is data.frame > Here my data set: d1_2 > > Year ID Age Reproductive_status Rank_Residuals Asso.Y1 TotalY1 > 1994 109 8 Lactating 0.23947902 9 48 > 1994 110 6 Barren -0.030977951 56 62 > 1995 1000 9 Summer_yeld 0.08624 31 55 > 1995 103 4 Barren -0.06861 29 52 > 1996 23 8 Barren -0.015726749 64 64 > 1997 1000 11 Lactating 0.148665859 5 35 > 1997 103 6 Barren -0.116539886 51 51 > 2001 105 9 Lactating -0.036222842 27 28 > 2001 106 9 Barren 0.073777158 40 40 > 2001 116 8 Barren -0.015710059 5 31 is this your whole data set, or just the first few lines? (If the former, then you won't be able to fit the model you want -- there are not nearly enough data.) > library(lme4); library(MASS) > nb.glmer <- glmer.nb(Asso.Y1 ~ Reproductive_status * Age + > Reproductive_status * Rank_Residuals + Reproductive_status * I(Age^2) + > (1|ID) + (1|Year), offset = log(d1_2$TotalY1), data=d1_2) The fixed-effect part should be identical to: ~ Reproductive_status*(Rank_Residuals+poly(Age,2,raw=TRUE)) > > I have also tried because I found that glmer.nb is not well understood: > library(glmmADMB) > random <- MCMCglmm(cbind(Asso.Y1,TotalY1-Asso.Y1) ~ Reproductive_status > * Age + Reproductive_status * Rank_Residuals + Reproductive_status * > I(Age^2), random = ~ ID+Year, data = d1_2) > BUT: Error in MCMCglmm(cbind(Asso.Y1, TotalY1 - Asso.Y1) ~ > Reproductive_status * : > family must have the same length as the number of responses > > I am not able to solve those problems and I have looked on forums too. > > Tkx in advance! You're loading the glmmADMB package but calling MCMCglmm, which is a completely different function from a completely different package, with different syntax ... ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.