Skip to content
Prev 8499 / 20628 Next

Question of ineraction in LMM model

On Mon, Jun 25, 2012 at 10:30 PM, chenlei <chenlei at ibcas.ac.cn> wrote:
When you see errors, we need information about possible causes.

Step one. Please report output from
Step two. Put your data on a server somewhere so we can see it and run
your example code with it.  if the data is huge, make a small subset
we can test to reproduce your trouble.

Now, about your lmer usage:

Better to do it with a data frame, ie, put y, x1, x2 in dat, and run

m1 <- lmer(y ~ x1 + x2 + (1|x2), data = dat)

Generally, I get better results using a data frame.   Depending on the
routine to go find data in your workspace is risky, not just with
lmer, but with any regression function. Using a data frame gives you
security that it is finding what you want.

Although it may not cause an error now in R, it used to be that a
variable named "plot" could be confused with the commonly used
function "plot". When something goes wrong, I always worry about
things like that.  For the same reason, I never name variables "lm",
"rep", "seq", "plot" "glm" and so forth.  Those things used to cause R
to crash, and somewhere deep in my heart I'm still suspicious when
people do that.
That means the author of glht needs to update code to not run
mean(data) any more. You are not causing that, unless your version of
the package is outdated.

You probably should show us the output of the summary of your lmer
model. Whether or not the hypothesis test is reasonable may depend on
the format of the output.  If you are confident the lmer output is
really what you want, then you need to send the lmer output to the
glht author and ask the usage question.  That's a big IF, though.

pj