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

Michael Cone coanil at posteo.org
Fri Sep 26 07:40:35 CEST 2014


Dear Russ,

thank you for the suggestion, I will have a look at the lsmeans package.

Best wishes,
Michael

On 25.09.2014 17:43, Lenth, Russell V wrote:
> 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
> 
> _______________________________________________
> 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