[R-sig-ME] Confidence interval for sum of coefficients

Lenth, Russell V russell-lenth at uiowa.edu
Thu Sep 25 17:43:36 CEST 2014


An easy way to get the results you want based on the adjusted variance-covariance matrix is:

    library(lsmeans)
    lsmeans(fm1, "Machines")

The adjustments and d.f. are made using pbkrtest's 'vcovAdj' and 'Lb_ddf' functions.

Russ Lenth

-----Original Message-----
Message: 1
Date: Thu, 25 Sep 2014 14:11:04 +0200
From: Michael Cone <coanil at posteo.org>
To: r-sig-mixed-models at r-project.org
Subject: [R-sig-ME] Confidence interval for sum of coefficients
Message-ID: <14644c74d26e578b64eb4697fed609a5 at posteo.de>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Hello,

I suspect this to be simple, but I can't figure it out.

> library(lme4)
> data(Machines)
> fm1 <- lmer(score ~ Machine + (Machine | Worker), data = Machines)
> summary(fm1)
Fixed effects:
             Estimate Std. Error t value
(Intercept)   52.356      1.681  31.151
MachineB       7.967      2.421   3.291
MachineC      13.917      1.540   9.036
> confint(fm1)
                  2.5 %     97.5 %
[...]
(Intercept) 48.7964047 55.9147119
MachineB     2.8401623 13.0931789
MachineC    10.6552809 17.1780575

[and 14 warnings, but it's just an example:
In optwrap(optimizer, par = start, fn = function(x) dd(mkpar(npar1,  ... 
:
convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded ...
In profile.merMod(object, signames = oldNames, ...) : non-monotonic profile]

I'd like to have confidence intervals for the overall score of MachineA, MachineB, and MachineB. MachineA is easy (CI of the intercept), but how do I combine the CI of the intercept with the CI of the MachineB parameter, and likewise the CI of the intercept with the parameter of MachineC? Can I simply add the lower and upper bounds of the two intervals or is this naive?

Thank you for your time,

Michael



More information about the R-sig-mixed-models mailing list