2
$\begingroup$

I have a model:

$y=a+bx+\varepsilon_1$ for each observation (tree)

$b=c+dz+\varepsilon_2$ for each forest (group of trees)

$y$, $x$, $z$ are continuous variables. $a$, $b$, $c$, $d$ are coefficients. $z$ is a property of forests (not individual trees). Error $\varepsilon_1$ is normally distributed and varies by tree. Error $\varepsilon_2$ varies by forest and not much is known about its distribution.

Is this lme4 model specification correct?

lmer(y~x+x:z+(0+x|forest))

I will greatly appreciate your help!

$\endgroup$

1 Answer 1

4
$\begingroup$

Nominally, you are right, but it looks odd that you force no random intercept in the model, which smells like regression through the origin, in terms of making strong assumptions that some terms (or some sources of variability) in the model are zero. I would start with

lmer(y~x+x:z+(1+x|forest))

instead and see how that works.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.