[R-sig-ME] lme4: Parameter contrasts?

Ben Bolker bbolker at gmail.com
Thu Feb 5 02:34:18 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15-02-04 08:25 PM, Carpenter, Tom wrote:
> Hoping someone has some advice here. I recently made the switch
> from using HLM to lmer. I know that in HLM, you could do a
> parameter contrast (e.g., contrast two fixed effects against each
> other and test the significance of the contrast). I was curious if
> anyone knows how to do this in R? I have run a model in lmer (with
> standardized predictors) and wish to see if one fixed effect is
> significantly larger (more predictive) than other fixed effect.
> 
> If that is not possible in lme4, does anyone have any advice for
> how to bootstrap it? I?m fine letting the thing run overnight to
> get a 95% CI if anyone has any suggestions.
> 
> Tom Carpenter, Ph.D. Instructor of Psychology Seattle Pacific 
> University 3307 3rd Ave W. Suite 107, Seattle, WA, 98119 
> tcarpenter at spu.edu<mailto:tcarpenter at spu.edu> Office: (206)
> 281-2916 Fax: (206) 281-2695
> 

  I'm pretty sure that Russ Lenth's "lsmeans" package works with
merMod objects.

  bootstrapping would go something like

  bootMer(fitted, FUN = function(m) { f <- fixef(m); f[3]-f[1] })

(for example, to compare fixed effect parameters #3 and #1).  The PB
estimates would probably be a little bit better (i.e., take account of
more aspects of variation) than the lsmeans() contrast, which would be
conditional on the estimates of the RE variance ...

  (however, you might conceivably run into problems with
https://github.com/lme4/lme4/issues/231 , which we haven't gotten
around to fixing yet ...)

  Ben Bolker

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJU0siaAAoJEOCV5YRblxUHEvkIALJns7YtDxYv49uxRTcDk2Ms
dMbS1ppo9NY1jAbrC24B1ANBctZUxGI3be889dvXBR3kZLPTW5F3ajM6J5DLEXDt
xXJ7QVT4fz6TvUztmWhZFhNBFT8HJYXSfcLCiXVuXiW1K2Wv7mW2FetplgFKrEho
wJbFCbxi/0/xFjJJbIRDXTZS2JBSklVN/TmBCeOW+ky3dQ4m62amKtuMiaTdjFL1
BTByO9iAS3mt6GXM88ztxrCODZoCgGrFaMVg5KQyAxD8F+2BWmnna2QGdkQg0abV
BWdeZZiCPeHYxO9kEsifReDrYNOKIhMED+plgKD9k08+eY1YSjBMiB/5SGmakvU=
=bb22
-----END PGP SIGNATURE-----



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