Dear K,
On Tue, 27-05-2014, at 06:33, KQ <
piensagl...@gmail.com> wrote:
> Hi Ramon and Håvard,
> I know I am joining this thread late, but I just wanted to jump off the
> same question that Ramon initially had. I am facing the same issue using
> glmer in the lme4 package using a Poisson distribution and facing problems
> with overdispersion. Lme4 no longer supports "quasi" families, but other
> options like glm do not incorporate random effects. Therefore, I have
> looked into two other options: 1) the package mcmcglmm (which I am not
> familiar with in theory or practice) and 2) adding in observation level
> random effects into the lme4 model (my preference).
> I have looked around for a workable example but have thus far have not
> found any. Would either of you be willing to share an example you might
> have?
Hummm... I am not sure I see the problem. Here are a few thoughts:
1. With INLA, as Havard explained, you can add an observation-level random
effect:
inla(Y ~ x1 + x2 + x3 + f(z, model = "iid") + f(
observation.id, model =
"iid"), )
where z is the random effect, and
observation.id is something you can
create as
observation.id <- factor(1:nrow(mydata))
(converting it to factor is not needed, but I do it anyway, to prevent
problems in other places, not INLA related).
By the way, that is the same as in the page you link below:
idx = 1:n
result = inla( y ~ 1 + f(idx, model="iid")
What is not entirely clear to me is how to asses when you really need to
add that observation-level random effect. But that is a different story.
2. With nlme you can do something similar. The syntax will be different, of
course ( (1|
observation.id)), but it is immediate.
3. If you do not have huge that, you can try running both INLA and
MCMCglmm, to double check you are fitting similar models. Or try it in a
small sample of your data.
But that is for a binomial with N = 1. You said you had Poisson counts.
> Any simplified explanation of how to choose the level of the unit and then
> incorporate that into the glmer model would be much appreciated if
> possible!
That is what I do not understand. You just create the 1:n identifier of
observations, and add it to the model.
Best,
R.
--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-25
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain
Phone:
+34-91-497-2412
Email:
rdi...@gmail.com
ramon...@iib.uam.es
http://ligarto.org/rdiaz