Negative Binomial in glmmadmb
I guess the question is what you want to plot ... do you want to plot graphical diagnostics (Q-Q, residuals vs fitted, etc.) as in the standard R plot.* methods for models, predictions, effects, ... ? Keep in mind that glmmTMB is brand new -- if you're having issues with the predictions, you should probably let the developers know what they are by posting an issue at https://github.com/glmmTMB/glmmTMB/issues ... cheers Ben Bolker
On 16-07-06 09:21 AM, Chad Newbolt wrote:
Which graphical package is recommended to be used in conjunction with glmmTMB? ggplot2? Specifically, I would like to use the predict function but have been having a few issues. As stated, I'm a relative novice with R (even more so with graphical packages in R) and trying to learn largely on my own so please excuse simplicity of questions. Thanks, Chad
________________________________ From: Mollie Brooks <mbrooks at ufl.edu> Sent: Tuesday, July 5, 2016 12:10 PM To: Chad Newbolt Cc: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] Negative Binomial in glmmadmb Hi Chad, I?ve been using AICtab from the bbmle package. If you have any NAs, you may need to be vigilant that the various models really are using the same data. I haven?t carefully checked that part of the functionality yet. cheers, Mollie ------------------------ Mollie Brooks, PhD Postdoctoral Researcher, Population Ecology Research Group Department of Evolutionary Biology & Environmental Studies, University of Z?rich http://www.popecol.org/team/mollie-brooks/ On 5Jul 2016, at 19:03, Chad Newbolt <newboch at auburn.edu<mailto:newboch at auburn.edu>> wrote: Can aictabs be used in conjunction with the glmmTMB package and/or there any alternatives that will quickly accomplish the same thing? I've tried aictabs and does not seem to work at first attempt. Chad ________________________________________ From: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org<mailto:r-sig-mixed-models-bounces at r-project.org>> on behalf of Chad Newbolt <newboch at auburn.edu<mailto:newboch at auburn.edu>> Sent: Friday, July 1, 2016 7:29 PM To: r-sig-mixed-models at r-project.org<mailto:r-sig-mixed-models at r-project.org>
Subject: Re: [R-sig-ME] Negative Binomial in glmmadmb
I had to use: family=list(family="nbinom1", link="log") in glmmTMB whereas family="nbinom1" had previously worked in glmmADMB. Thanks for pointing me towards examples. ________________________________________ From: Philipp Singer <killver at gmail.com<mailto:killver at gmail.com>> Sent: Friday, July 1, 2016 2:53 PM To: Chad Newbolt; r-sig-mixed-models at r-project.org<mailto:r-sig-mixed-models at r-project.org>
Subject: Re: [R-sig-ME] Negative Binomial in glmmadmb
Exactly as you would do it in glmmADMB, just replace ADMB with TMB... Check the github examples: https://github.com/glmmTMB/glmmTMB/tree/master/glmmTMB/tests/testthat On 01.07.2016 21:47, Chad Newbolt wrote: Thanks so much for the response. I know this is probably very simple but how do I denote the family as negative binomial using glmmTMB? I've dug through text regarding this package and have had trouble coming up with anything that works. Chad ________________________________________ From: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> on behalf of Ben Bolker <bbolker at gmail.com> Sent: Thursday, June 30, 2016 7:45 PM To: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] Negative Binomial in glmmadmb Chad Newbolt <newboch at ...> writes: [snip] Since I have evidence for overdispersion, I'm using negative binomial distribution as opposed to Poisson. My two questions are: 1) When I fit using the following global zero inflation model I receive the following error: fit1=glmmadmb(Fawn~Age+I(Age^2)+BodySize+SSCM+AvgAge+Age*AvgAge+ I(Age^2)*AvgAge+BodySize*AvgAge+SSCM*AvgAge+(1|Sire), data=datum,family="nbinom",zeroInflation = TRUE) I think you can shorten this a bit to (Age+I(Age^2)+BodySize+SSCM)*AvgAge + (1|Sire) Parameters were estimated, but standard errors were not: the most likely problem is that the curvature at MLE was zero or negative Error in glmmadmb(Fawn ~ Age + I(Age^2) + BodySize + SSCM + AvgAge + Age * : The function maximizer failed (couldn't find parameter file) Troubleshooting steps include (1) run with 'save.dir' set and inspect output files; (2) change run parameters: see '?admbControl';(3) re-run with debug=TRUE for more information on failure mode In addition: Warning message: running command 'C:\windows\system32\cmd.exe /c glmmadmb -maxfn 500 -maxph 5 -noinit -shess' had status 1 However, when I change to zeroInflation = FALSE, I receive no warnings and everything seems to go as should. Does this simply mean that my data is not zero inflated, hence the zero inflated model will not run, or is this something I should be concerned about and investigate the cause further? When I debug I see the following warning....Warning -- Hessian does not appear to be positive definite Hessian does not appear to be positive definite. 2) When fitting more simple versions(predictors removed) I receive the same error as above when using the family=nbinom; however these errors disappear when using family=nbinom1. Is this indicative of an underlying problem or am I OK to use the ouput from the later family where variance = ??. Thanks, Chad [[alternative HTML version deleted]] Short answer: you should be a little concerned, and you should not assume that your data are not zero-inflated. These are not indications about what your model is actually finding, just indications that ADMB ran into *some* kind of trouble. Unfortunately, there is no really simple guide to trouble-shooting these kinds of problems. Some general suggestions: * try out the glmmTMB package - it's newer/experimental, but often more stable * the ?admbControl man page suggests trying shess=FALSE and noinit=FALSE * it may not help in this case, but centering continuous predictors is always worth a shot * similarly, poly(Age,2) is a little more stable than (Age+I(Age^2)) * inspect your data graphically to see whether there are outliers or other odd patterns that might be messing up the fit
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models [[alternative HTML version deleted]] _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models