[R] Walds Z in a mixed model

Daniel Bolnick danbolnick at mail.utexas.edu
Tue Mar 18 14:19:24 CET 2008


I recently reviewed a paper that used Wald's Z in a mixed model 
analysis. The dataset (see end of message for complete dataset) has 
individual animals (SAMPLE) from within social groups, from within 
geographic regions. Y is the response variable. The paper ran a mixed 
model with year and region as fixed effects, group a random effect 
nested within region, and sample nested within group. I found this 
odd, as that leaves no information for an error term (there is no 
replication within individual. The author wanted to determine what 
fraction of the variation in Y was due to each of these terms, and of 
greatest interest was whether there was appreciable 
within-group   (among Sample nested within group) variance. He/she 
applied Wald's Z in SPSS, which provides estimates of variance 
components as well as standard errors of these estimates. Wald's Z is 
just an F statistic with the variance/se(variance).
Here are my two questions:
1) lacking access to Pinhero and Bates at the moment, what is the 
appropriate model structure in lmer or nlme for this model (year and 
region fixed, group random nested within fixed region effect, and 
sample nested within group?
2) How can I obtain s.e(variance) to obtain Wald's Z?
Thanks!
-Dan Bolnick


         SAMPLE       REGION      GROUP YEAR   Y
1   IngM03BS-1     mainland    Mystery    3 -23.68
2   IngM03BS02     mainland    Mystery    3 -23.61
3  IngM03BS-04     mainland    Mystery    3 -23.76
4   IngM02BS01     mainland    Mystery    2 -23.61
5   IngM02BS02     mainland    Mystery    2 -24.37
6   IngM02BS03     mainland    Mystery    2 -23.93
7    Ing03BS05     mainland    Mystery    3 -23.88
8   ELLM04BS03     mainland    Mystery    4 -23.66
9   EllM04BS02     mainland    Mystery    4 -23.59
10   CIM03BS01     mainland   Mountain    3 -22.79
11  POWM03BS03     mainland   Mountain    3 -21.08
12  POWM03BS02     mainland   Mountain    3 -20.42
13   ClM01BS02     mainland   Mountain    1 -20.81
14   CPM01BS01     mainland   Mountain    1 -21.04
15   ClM01Ca01     mainland   Mountain    1 -22.95
16    NK03BS04     mainland   Mosquito    3 -23.01
17   NkM03BS02     mainland   Mosquito    3 -23.45
18  ROSM03BS02     mainland BigCountry    3 -22.33
19  ROSM03BS03     mainland BigCountry    3 -23.61
20  ROSM03BS02     mainland BigCountry    3 -22.80
21  ROSMB03S01     mainland BigCountry    3 -22.96
22   AAM01Ca02     mainland      Alice    1 -20.63
23   AAM01Ca03     mainland      Alice    1 -20.83
24   ElM04Ca01     mainland      Elcho    4 -21.11
25   YeI03BS05 innerislands    Village    3 -19.82
26   YeI03BS01 innerislands    Village    3 -18.07
27   YeI03BS04 innerislands    Village    3 -20.70
28   YeI03BS03 innerislands    Village    3 -19.37
29   YeI03BS06 innerislands    Village    3 -21.14
30   YeI03BS02 innerislands    Village    3 -21.25
31   YeI02BS02 innerislands    Village    2 -20.98
32   YeI02BS04 innerislands    Village    2 -20.40
33   YeI02BS05 innerislands    Village    2 -19.96
34   YeI00BS01 innerislands    Village    1 -23.34
35   YeI00BS02 innerislands    Village    1 -23.06
36   YeI01DS01 innerislands    Village    1 -22.10
37   YeI04BS02 innerislands    Village    4 -20.81
38   YeI04S01T innerislands    Village    4 -19.75
39   HuI04BS01 innerislands      Ochre    4 -21.17
40   DeI03BS01 innerislands      Local    3 -20.78
41   CaI03Ca01 innerislands      Local    3 -22.59
42   ChI02BS01 innerislands   Fishtrap    2 -17.73
43   ChI02BS02 innerislands   Fishtrap    2 -18.24
44   ChI02BS03 innerislands   Fishtrap    2 -18.74
45   ChI02DS01 innerislands   Fishtrap    2 -19.23
46   ChI01BS05 innerislands   Fishtrap    2 -16.78
47   ChI01DS01 innerislands   Fishtrap    1 -21.17
48   ChI01DS02 innerislands   Fishtrap    1 -20.70
49   ChI01DS03 innerislands   Fishtrap    1 -21.07
50   ChI01HS01 innerislands   Fishtrap    1 -19.07
51   ChI01BS01 innerislands   Fishtrap    1 -21.53
52   ChI01BS03 innerislands   Fishtrap    1 -18.32
53   ChI01BS05 innerislands   Fishtrap    1 -17.32
54   ChI01BS06 innerislands   Fishtrap    1 -18.39
55  CuII01BS01 innerislands   Fishtrap    1 -23.48
56  CuII01BS02 innerislands   Fishtrap    1 -22.82
57  CuII01BS03 innerislands   Fishtrap    1 -22.19
58   SuI03BS01 innerislands      Susan    3 -22.35
59   SuI03DS01 innerislands      Susan    3 -21.70
60   SuI03BS02 innerislands      Susan    3 -22.25
61   SuI04BS01 innerislands      Susan    4 -22.57
62   SuI04BS02 innerislands      Susan    4 -22.08
63   SuI04BS02 innerislands      Susan    4 -21.73
64   PRI03BS01 innerislands   Princess    3 -18.11
65   PRI03BS02 innerislands   Princess    3 -21.59
66   HaI03BS03 innerislands Hawkesbury    3 -17.56
67   HaI03BS02 innerislands Hawkesbury    3 -17.68
68   HaI01BS01 innerislands Hawkesbury    1 -18.43
69   HaI01Ca01 innerislands Hawkesbury    1 -18.12
70   FiI01BS01 innerislands        Fin    1 -21.92
71   GiI01BS01 outerislands        Gil    1 -17.17
72   GiI01BS02 outerislands        Gil    1 -18.21
73   GiI01BS05 outerislands        Gil    1 -16.54
74   GiI01BS04 outerislands        Gil    1 -17.47
75   GiI01BS03 outerislands        Gil    1 -19.01
76   DuI03BS01 outerislands     Dundas    3 -15.07
77   DuI03BS02 outerislands     Dundas    3 -15.42
78   BaI03BS02 outerislands      Banks    3 -18.50



More information about the R-help mailing list