[R-sig-ME] lme4 merMod model object
Nathan Pace
n.l.pace at utah.edu
Mon Nov 20 06:06:08 CET 2017
Hi John,
Your example was just what I needed.
I can see now that your example is an illustration of this sentence in the documentation:
“Alternatively, the hypothesis can be specified symbolically as a character vector with one or more
elements, each of which gives either a linear combination of coefficients, or a linear equation in the
coefficients (i.e., with both a left and right side separated by an equals sign).”
I must confess to an inability at times to translate words in documentation into code.
So, you sample code was very helpful.
Nathan
On 1811//2017, 7:45 AM, "Fox, John" <jfox at mcmaster.ca> wrote:
Dear Nathan,
Yes, you should be able to use linearHypothesis() in the car package. The command would be something like
linearHypothesis(your.model, c("coef1 - coef2 = 0", "coef3 - coef4 = 0"))
You could equivalently specify the hypothesis as c("coef1 - coef2", "coef3 - coef4"), with the 0s implied, or as c("coef1 = coef2", "coef3 = coef4 ").
I'm curious why that wasn't clear from ?linearHypothesis.
I hope this helps,
John
-----------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/
> -----Original Message-----
> From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces at r-project.org]
> On Behalf Of Nathan Pace
> Sent: Friday, November 17, 2017 7:02 PM
> To: R-sig-mixed-models <r-sig-mixed-models at r-project.org>
> Subject: [R-sig-ME] lme4 merMod model object
>
> Hi mixed model experts,
>
> I have a GLMM (binomial) model estimated in lme4 using glmer.
>
> There are many linear coefficients such as coef1, coef2, coef3, coef4, …
>
> I have used glht from multcomp to test coefficient contrasts such as coef1 –
> coef2 = 0.
>
> Now I desire to test sets of linear contrasts in the model jointly such as coef1 –
> coef2 = 0 & coef3 – coef4 = 0.
>
> By my reading, this should be possible in the linearHypothesis function of the
> car package.
>
> If someone has already used sets of contrast vectors for that purpose, I would
> appreciate learning of the format.
>
> Thanks,
>
> vd
> Nathan Pace
> University of Utah
>
>
> ___________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list