From: Vincent Dorie <vjd4 at nyu.edu>
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Error fitting reduced model in bglmer for LRT
Message-ID: <9FBE19D0-EA83-4F5B-8333-0C52C18390D9 at nyu.edu>
Content-Type: text/plain; charset=utf-8
I don't know what exactly anova() does for glmms, but I wouldn't recommend
a likelihood ratio test to compare posterior modes unless you can be
certain the data swamp the prior.
The error you experienced is a copy/paste error on my part. You can run
the code below to fix it temporarily, until I can get a new release on CRAN.
assignInNamespace("toString.bmerTDist", function(x, digits =
getOption("digits"), ...) {
scaleString <- ""
scale <- crossprod(solve(x at R.scale.inv))
if (nrow(scale) > 2) {
scaleString <- paste("scale = c(", toString(round(scale[1:4],
digits)), ", ...)", sep = "")
} else if (nrow(scale) == 2) {
scaleString <- paste("scale = c(", toString(round(scale[1:4],
digits)), ")", sep = "")
} else {
scaleString <- paste("scale = ", toString(round(scale[1], digits)),
sep = "")
}
paste("t(df = ", x at df, ", ", scaleString,
", common.scale = ", x at commonScale,
")", sep="")
}, "blme")
Vince
On Mar 9, 2015, at 11:47 PM, Josie Galbraith <josie.galbraith at gmail.com>
separation in my data, I've come up against a problem trying to fit
models for testing the model terms using likelihood ratio tests (LRT).
Firstly, can I use LRTs (anova()) for testing the fixed effects of bglmer
models, as I would for glmer models?
If yes, then I need help understanding why I'm getting the following
fitting a reduced bglmer model:
"Error in if (nrow(cov) == 2) { : argument is of length zero"
This is my full model:
SE.les.mod = bglmer (LESION ~ FOOD*SEASON +(1|SITE), data = SEYE.df,
= binomial, fixef.prior = t(1,2.5), cov.prior = NULL)
I can fit a model without the interaction term ok:
SE.les.add = bglmer (LESION ~ FOOD+SEASON +(1|SITE), data = SEYE.df,
= binomial, fixef.prior = t(1,2.5), cov.prior = NULL)
But I get the error message with both of the single fixed effects models:
SE.les.FOOD = bglmer (LESION ~ SEASON +(1|SITE), data = SEYE.df, family =
binomial, fixef.prior = t(1,2.5), cov.prior = NULL)
SE.les.SEAS = bglmer (LESION ~ FOOD +(1|SITE), data = SEYE.df, family =
binomial, fixef.prior = t(1,2.5), cov.prior = NULL)
Thanks very much,
Josie
--
*Josie Galbraith* MSc (hons)
PhD candidate
*University of Auckland *
Joint Graduate School in Biodiversity and Biosecurity ? School of
Biological Sciences ? Tamaki Campus ? Private Bag 92019 ? Auckland 1142*
P:* 09-373 7599 ext. 83132* ? E:* josie.galbraith at gmail.com* ? W: * UoA