[R] weights argument in the lmer function in lme4

Patrick Connolly p.connolly at hortresearch.co.nz
Mon Jan 30 21:51:16 CET 2006


I suspect the weights argument is not having any effect.

Package:              Matrix
Version:              0.995-2
Date:                 2006-01-19


Beginning with this:

Browse[1]>   resp.lmer <- lmer(SensSSC ~ Block + Season + (1 | Plot) + (1 | Ma) + (1 | Pa) + 
+     (1 | MaPa), weights = SensSSC.N, data = xx)

I group the output into a table with my ran.eff function and get this:

Browse[1]> ran.eff(resp.lmer)
          01     02     03     04     05     06     07   GCAf RankF
A     13.714 13.709 13.886 14.124 15.120 13.546 14.586  0.472     1
B     13.452     NA 13.426 13.632 14.439 13.512 13.713  0.069     3
C     13.922 13.770 14.353     NA 14.661 13.529 14.367  0.453     2
D         NA     NA 13.353     NA     NA     NA     NA -0.051     4
E     12.775 12.767 12.823 12.767 14.036 12.631 13.645 -0.495     6
F     13.043 13.338 12.641 12.977 13.848 12.425 13.530 -0.448     5
GCAm  -0.200 -0.169 -0.165 -0.103  0.736 -0.428  0.329     NA    NA
RankM  6.000  5.000  4.000  3.000  1.000  7.000  2.000     NA    NA


Despite any shortcomings in my ran.eff function, those values look
alright, but they're the same (to any number of decimal places) as I'd
get without a weights argument.  Just to check that the weights really
don't effect it, I tried using only the rows with a weight of 5
(almost 90% of the data) but it was substantially different.

Browse[1]>   resp.lmer5 <- lmer(SensSSC ~ Block + Season + (1 | Plot) + (1 | Ma) + (1 | Pa) + 
+     (1 | MaPa), subset = SensSSC.N == 5, data = xx)

Browse[1]> ran.eff(resp.lmer5)
          01     02     03     04     05     06     07   GCAf RankF
A     13.435 13.349 13.595 13.914 14.722 13.161 14.414  0.345     2
B     13.068     NA 13.110 13.447 14.121 13.296 13.637 -0.014     4
C     13.702 13.537 14.256     NA 14.371 13.575 14.247  0.469     1
D         NA     NA 13.276     NA     NA     NA     NA -0.001     3
E     12.717 12.659 12.786 12.719 13.642 12.659 13.556 -0.425     6
F     13.015 13.101 12.549 12.920 13.629 12.438 13.474 -0.374     5
GCAm  -0.210 -0.230 -0.146 -0.049  0.596 -0.353  0.391     NA    NA
RankM  5.000  6.000  4.000  3.000  1.000  7.000  2.000     NA    NA

That seems to indicate that weights cannot be readily ignored.

Has anyone had experience to indicate that the weights argument does
produce a difference, and so I should be looking somewhere else for
the reason why I'm getting such results?


TIA

-- 
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand 
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~




More information about the R-help mailing list