Skip to content

contrast in glmer

2 messages · Douglas Bates, Kay Cichini

#
At the end of your query you mention that you didn't know of a place
to send such queries other than to the package authors.  The best
place to send such queries is the to R-SIG-Mixed-Models at R-project.org
mailing list, which I am cc:ing on this reply.

On Mon, Dec 19, 2011 at 10:14 AM, Magal? Matteodo
<magali.matteodo at gmail.com> wrote:
Like most model-fitting methods in R that rely on a linear predictor,
glmer outsources construction of the model matrix to the function
model.matrix so the question really comes down to how model.matrix
behaves.  It uses the default contrasts specified in the "contrasts"
option.  The factory-fresh setting is
unordered           ordered
"contr.treatment"      "contr.poly"

If you want to change this for all factors you can reset that option.
If you want to change it for only one factor then you can set the
contrasts attribute on that particular factor (see ?contrasts for more
explanation) or specify the name of the contrasts-generating function
in a named lists given as the contrasts argument passed to glmer (see
?model.matrix for more details).  It might also help to run

example(contrasts)

and

example(model.matrix)
#
Hi Magali,
Dear Mr. Bates,

with my work I had a similar problem. However, I utilized multiple  
comparisons (package multcomp) to get around this.

Magali, if you want to consider this approach, this stand-alone  
example may help:
http://thebiobucket.blogspot.com/2011/06/glmm-with-custom-multiple-comparisons.html

On my own behalf I'd be happy about expert comments on the above  
mentioned method.

Cheers,
Kay


Zitat von Douglas Bates <bates at stat.wisc.edu>: