lmer通过重复测量嵌套随机效应

时间:2017-03-28 17:41:44

标签: r nested lme4 mixed-models

首先,这里有一点关于我的实验设计。我操纵冬季和夏季降水的方式是每个冬季子图在夏季情节中嵌套。然后我有三个重复(块)。我在不同日期的每个子图的相同区域进行了植物群落测量。我想确保我正确地考虑我的随机效应,其中块是随机的,子图嵌套在图中,并且重复测量。我已经尝试查找有关如何正确执行此操作的多个响应,但已经缩短了。

在这一点上,我已经提出这个模型是最好的,但我不认为它解释了重复的措施方面。

lmer(Percent.cover~Winter*Summer*Month*Year * species + (1|Block) + (1|Plot/Subplot), data = data) 

这是一些模拟数据:

    Year Block Plot Subplot  Winter  Summer Month          species Percent.cover
1   2015     1    3       C     Dry     Wet   Jun       Clear.Weed            18
2   2015     1    3       A     Wet     Wet   Jun       Clear.Weed             1
3   2015     1    3       B Control     Wet   Jun       Clear.Weed            47
4   2015     1    2       C     Wet     Dry   Jun       Clear.Weed            22
5   2015     1    2       A     Dry     Dry   Jun       Clear.Weed             8
6   2015     1    2       B Control     Dry   Jun       Clear.Weed            37
7   2015     1    1       C Control Control   Jun       Clear.Weed            37
8   2015     1    1       B     Wet Control   Jun       Clear.Weed            44
9   2015     1    1       A     Dry Control   Jun       Clear.Weed            33
10  2015     3    3       A Control     Wet   Jun       Clear.Weed            16
11  2015     3    3       B     Wet     Wet   Jun       Clear.Weed            43
12  2015     3    3       C     Dry     Wet   Jun       Clear.Weed            35
13  2015     3    2       C     Wet Control   Jun       Clear.Weed            45
14  2015     3    2       A     Dry Control   Jun       Clear.Weed            35
15  2015     3    2       B Control Control   Jun       Clear.Weed            11
16  2015     3    1       C     Dry     Dry   Jun       Clear.Weed            31
17  2015     3    1       A Control     Dry   Jun       Clear.Weed             8
18  2015     3    1       B     Wet     Dry   Jun       Clear.Weed            42
19  2015     2    3       C Control Control   Jun       Clear.Weed            43
20  2015     2    3       A     Wet Control   Jun       Clear.Weed            46
21  2015     2    3       B     Dry Control   Jun       Clear.Weed            12
22  2015     2    2       C     Dry     Wet   Jun       Clear.Weed            39
23  2015     2    2       A Control     Wet   Jun       Clear.Weed            19
24  2015     2    2       B     Wet     Wet   Jun       Clear.Weed            28
25  2015     2    1       C Control     Dry   Jun       Clear.Weed            33
26  2015     2    1       A     Wet     Dry   Jun       Clear.Weed            10
27  2015     2    1       B     Dry     Dry   Jun       Clear.Weed            13
28  2015     1    3       C     Dry     Wet   Sep       Clear.Weed            42
29  2015     1    3       B Control     Wet   Sep       Clear.Weed            40
30  2015     1    3       A     Wet     Wet   Sep       Clear.Weed            26
31  2015     1    2       A     Dry     Dry   Sep       Clear.Weed            22
32  2015     1    2       B Control     Dry   Sep       Clear.Weed            31
33  2015     1    2       C     Wet     Dry   Sep       Clear.Weed            13
34  2015     1    1       A     Dry Control   Sep       Clear.Weed            15
35  2015     1    1       C Control Control   Sep       Clear.Weed            34
36  2015     1    1       B     Wet Control   Sep       Clear.Weed            26
37  2015     2    3       A Control Control   Sep       Clear.Weed            47
38  2015     2    3       B     Dry Control   Sep       Clear.Weed            21
39  2015     2    3       C     Wet Control   Sep       Clear.Weed             4
40  2015     2    2       A Control     Wet   Sep       Clear.Weed            44
41  2015     2    2       B     Wet     Wet   Sep       Clear.Weed            31
42  2015     2    2       C     Dry     Wet   Sep       Clear.Weed             9
43  2015     2    1       C Control     Dry   Sep       Clear.Weed            49
44  2015     2    1       A     Wet     Dry   Sep       Clear.Weed            45
45  2015     2    1       B     Dry     Dry   Sep       Clear.Weed            31
46  2015     3    3       B     Wet     Wet   Sep       Clear.Weed             9
47  2015     3    3       C     Dry     Wet   Sep       Clear.Weed            10
48  2015     3    3       A Control     Wet   Sep       Clear.Weed            19
49  2015     3    2       B Control Control   Sep       Clear.Weed            43
50  2015     3    2       C     Wet Control   Sep       Clear.Weed             5
51  2015     3    2       A     Dry Control   Sep       Clear.Weed             6
52  2015     3    1       C     Dry     Dry   Sep       Clear.Weed            10
53  2015     3    1       B     Wet     Dry   Sep       Clear.Weed             2
54  2015     3    1       A Control     Dry   Sep       Clear.Weed            25
55  2016     1    3       C     Dry     Wet   Jun       Clear.Weed            18
56  2016     1    3       A     Wet     Wet   Jun       Clear.Weed            48
57  2016     1    3       B Control     Wet   Jun       Clear.Weed            35
58  2016     1    2       C     Wet     Dry   Jun       Clear.Weed             1
59  2016     1    2       A     Dry     Dry   Jun       Clear.Weed            10
60  2016     1    2       B Control     Dry   Jun       Clear.Weed            12
61  2016     1    1       C Control Control   Jun       Clear.Weed             8
62  2016     1    1       B     Wet Control   Jun       Clear.Weed            25
63  2016     1    1       A     Dry Control   Jun       Clear.Weed            49
64  2016     3    3       A Control     Wet   Jun       Clear.Weed            16
65  2016     3    3       B     Wet     Wet   Jun       Clear.Weed            19
66  2016     3    3       C     Dry     Wet   Jun       Clear.Weed             5
67  2016     3    2       C     Wet Control   Jun       Clear.Weed             1
68  2016     3    2       A     Dry Control   Jun       Clear.Weed            15
69  2016     3    2       B Control Control   Jun       Clear.Weed            21
70  2016     3    1       C     Dry     Dry   Jun       Clear.Weed            48
71  2016     3    1       A Control     Dry   Jun       Clear.Weed            27
72  2016     3    1       B     Wet     Dry   Jun       Clear.Weed             7
73  2016     2    3       C Control Control   Jun       Clear.Weed            29
74  2016     2    3       A     Wet Control   Jun       Clear.Weed             7
75  2016     2    3       B     Dry Control   Jun       Clear.Weed            36
76  2016     2    2       A Control     Wet   Jun       Clear.Weed             6
77  2016     2    2       C     Dry     Wet   Jun       Clear.Weed            45
78  2016     2    2       B     Wet     Wet   Jun       Clear.Weed            38
79  2016     2    1       C Control     Dry   Jun       Clear.Weed            22
80  2016     2    1       A     Wet     Dry   Jun       Clear.Weed            48
81  2016     2    1       B     Dry     Dry   Jun       Clear.Weed            46
82  2016     1    3       C     Dry     Wet   Sep       Clear.Weed            39
83  2016     1    3       A     Wet     Wet   Sep       Clear.Weed            41
84  2016     1    3       B Control     Wet   Sep       Clear.Weed            27
85  2016     1    2       C     Wet     Dry   Sep       Clear.Weed            46
86  2016     1    2       A     Dry     Dry   Sep       Clear.Weed            32
87  2016     1    2       B Control     Dry   Sep       Clear.Weed            21
88  2016     1    1       C Control Control   Sep       Clear.Weed            28
89  2016     1    1       B     Wet Control   Sep       Clear.Weed            35
90  2016     1    1       A     Dry Control   Sep       Clear.Weed            23
91  2016     3    3       A Control     Wet   Sep       Clear.Weed             8
92  2016     3    3       B     Wet     Wet   Sep       Clear.Weed            46
93  2016     3    3       C     Dry     Wet   Sep       Clear.Weed            48
94  2016     3    2       C     Wet Control   Sep       Clear.Weed            24
95  2016     3    2       A     Dry Control   Sep       Clear.Weed             4
96  2016     3    2       B Control Control   Sep       Clear.Weed            39
97  2016     3    1       C     Dry     Dry   Sep       Clear.Weed            26
98  2016     3    1       A Control     Dry   Sep       Clear.Weed            47
99  2016     3    1       B     Wet     Dry   Sep       Clear.Weed            12
100 2016     2    3       C Control Control   Sep       Clear.Weed            11
101 2016     2    3       A     Wet Control   Sep       Clear.Weed            38
102 2016     2    3       B     Dry Control   Sep       Clear.Weed            19
103 2016     2    2       C     Dry     Wet   Sep       Clear.Weed            18
104 2016     2    2       B     Wet     Wet   Sep       Clear.Weed            14
105 2016     2    1       C Control     Dry   Sep       Clear.Weed            17
106 2016     2    1       A     Wet     Dry   Sep       Clear.Weed            34
107 2016     2    1       B     Dry     Dry   Sep       Clear.Weed            15
108 2015     1    3       C     Dry     Wet   Jun Black.Snake.Root            11
109 2015     1    3       A     Wet     Wet   Jun Black.Snake.Root            29
110 2015     1    3       B Control     Wet   Jun Black.Snake.Root             0
111 2015     1    2       C     Wet     Dry   Jun Black.Snake.Root             0
112 2015     1    2       A     Dry     Dry   Jun Black.Snake.Root            16
113 2015     1    2       B Control     Dry   Jun Black.Snake.Root            41
114 2015     1    1       C Control Control   Jun Black.Snake.Root             4
115 2015     1    1       B     Wet Control   Jun Black.Snake.Root            26
116 2015     1    1       A     Dry Control   Jun Black.Snake.Root             4
117 2015     3    3       A Control     Wet   Jun Black.Snake.Root             2
118 2015     3    3       B     Wet     Wet   Jun Black.Snake.Root            30
119 2015     3    3       C     Dry     Wet   Jun Black.Snake.Root            34
120 2015     3    2       C     Wet Control   Jun Black.Snake.Root             4
121 2015     3    2       A     Dry Control   Jun Black.Snake.Root             4
122 2015     3    2       B Control Control   Jun Black.Snake.Root            45
123 2015     3    1       C     Dry     Dry   Jun Black.Snake.Root            44
124 2015     3    1       A Control     Dry   Jun Black.Snake.Root             2
125 2015     3    1       B     Wet     Dry   Jun Black.Snake.Root            34
126 2015     2    3       C Control Control   Jun Black.Snake.Root            19
127 2015     2    3       A     Wet Control   Jun Black.Snake.Root            14
128 2015     2    3       B     Dry Control   Jun Black.Snake.Root            19
129 2015     2    2       C     Dry     Wet   Jun Black.Snake.Root            37
130 2015     2    2       A Control     Wet   Jun Black.Snake.Root            42
131 2015     2    2       B     Wet     Wet   Jun Black.Snake.Root            46
132 2015     2    1       C Control     Dry   Jun Black.Snake.Root            20
133 2015     2    1       A     Wet     Dry   Jun Black.Snake.Root            24
134 2015     2    1       B     Dry     Dry   Jun Black.Snake.Root             7
135 2015     1    3       C     Dry     Wet   Sep Black.Snake.Root            19
136 2015     1    3       B Control     Wet   Sep Black.Snake.Root            24
137 2015     1    3       A     Wet     Wet   Sep Black.Snake.Root            43
138 2015     1    2       A     Dry     Dry   Sep Black.Snake.Root            36
139 2015     1    2       B Control     Dry   Sep Black.Snake.Root            21
140 2015     1    2       C     Wet     Dry   Sep Black.Snake.Root            41
141 2015     1    1       A     Dry Control   Sep Black.Snake.Root            36
142 2015     1    1       C Control Control   Sep Black.Snake.Root            16
143 2015     1    1       B     Wet Control   Sep Black.Snake.Root            49
144 2015     2    3       A Control Control   Sep Black.Snake.Root            29
145 2015     2    3       B     Dry Control   Sep Black.Snake.Root            13
146 2015     2    3       C     Wet Control   Sep Black.Snake.Root            32
147 2015     2    2       A Control     Wet   Sep Black.Snake.Root            39
148 2015     2    2       B     Wet     Wet   Sep Black.Snake.Root            23
149 2015     2    2       C     Dry     Wet   Sep Black.Snake.Root            18
150 2015     2    1       C Control     Dry   Sep Black.Snake.Root             5
151 2015     2    1       A     Wet     Dry   Sep Black.Snake.Root            46
152 2015     2    1       B     Dry     Dry   Sep Black.Snake.Root             1
153 2015     3    3       B     Wet     Wet   Sep Black.Snake.Root            19
154 2015     3    3       C     Dry     Wet   Sep Black.Snake.Root            44
155 2015     3    3       A Control     Wet   Sep Black.Snake.Root             7
156 2015     3    2       B Control Control   Sep Black.Snake.Root            12
157 2015     3    2       C     Wet Control   Sep Black.Snake.Root            19
158 2015     3    2       A     Dry Control   Sep Black.Snake.Root            31
159 2015     3    1       C     Dry     Dry   Sep Black.Snake.Root            21
160 2015     3    1       B     Wet     Dry   Sep Black.Snake.Root            33
161 2015     3    1       A Control     Dry   Sep Black.Snake.Root            30
162 2016     1    3       C     Dry     Wet   Jun Black.Snake.Root            14
163 2016     1    3       A     Wet     Wet   Jun Black.Snake.Root             0
164 2016     1    3       B Control     Wet   Jun Black.Snake.Root            33
165 2016     1    2       C     Wet     Dry   Jun Black.Snake.Root            37
166 2016     1    2       A     Dry     Dry   Jun Black.Snake.Root            15
167 2016     1    2       B Control     Dry   Jun Black.Snake.Root            29
168 2016     1    1       C Control Control   Jun Black.Snake.Root             4
169 2016     1    1       B     Wet Control   Jun Black.Snake.Root            28
170 2016     1    1       A     Dry Control   Jun Black.Snake.Root            49
171 2016     3    3       A Control     Wet   Jun Black.Snake.Root            43
172 2016     3    3       B     Wet     Wet   Jun Black.Snake.Root            19
173 2016     3    3       C     Dry     Wet   Jun Black.Snake.Root             5
174 2016     3    2       C     Wet Control   Jun Black.Snake.Root            19
175 2016     3    2       A     Dry Control   Jun Black.Snake.Root            27
176 2016     3    2       B Control Control   Jun Black.Snake.Root            18
177 2016     3    1       C     Dry     Dry   Jun Black.Snake.Root            49
178 2016     3    1       A Control     Dry   Jun Black.Snake.Root            32
179 2016     3    1       B     Wet     Dry   Jun Black.Snake.Root            41
180 2016     2    3       C Control Control   Jun Black.Snake.Root             1
181 2016     2    3       A     Wet Control   Jun Black.Snake.Root            13
182 2016     2    3       B     Dry Control   Jun Black.Snake.Root            45
183 2016     2    2       A Control     Wet   Jun Black.Snake.Root            50
184 2016     2    2       C     Dry     Wet   Jun Black.Snake.Root            26
185 2016     2    2       B     Wet     Wet   Jun Black.Snake.Root            17
186 2016     2    1       C Control     Dry   Jun Black.Snake.Root            38
187 2016     2    1       A     Wet     Dry   Jun Black.Snake.Root             2
188 2016     2    1       B     Dry     Dry   Jun Black.Snake.Root            18
189 2016     1    3       C     Dry     Wet   Sep Black.Snake.Root            31
190 2016     1    3       A     Wet     Wet   Sep Black.Snake.Root            33
191 2016     1    3       B Control     Wet   Sep Black.Snake.Root             2
192 2016     1    2       C     Wet     Dry   Sep Black.Snake.Root            29
193 2016     1    2       A     Dry     Dry   Sep Black.Snake.Root            12
194 2016     1    2       B Control     Dry   Sep Black.Snake.Root             2
195 2016     1    1       C Control Control   Sep Black.Snake.Root             7
196 2016     1    1       B     Wet Control   Sep Black.Snake.Root            14
197 2016     1    1       A     Dry Control   Sep Black.Snake.Root            44
198 2016     3    3       A Control     Wet   Sep Black.Snake.Root            12
199 2016     3    3       B     Wet     Wet   Sep Black.Snake.Root            44
200 2016     3    3       C     Dry     Wet   Sep Black.Snake.Root            46
201 2016     3    2       C     Wet Control   Sep Black.Snake.Root             9
202 2016     3    2       A     Dry Control   Sep Black.Snake.Root            48
203 2016     3    2       B Control Control   Sep Black.Snake.Root             9
204 2016     3    1       C     Dry     Dry   Sep Black.Snake.Root            20
205 2016     3    1       A Control     Dry   Sep Black.Snake.Root             7
206 2016     3    1       B     Wet     Dry   Sep Black.Snake.Root             9
207 2016     2    3       C Control Control   Sep Black.Snake.Root            37
208 2016     2    3       A     Wet Control   Sep Black.Snake.Root            16
209 2016     2    3       B     Dry Control   Sep Black.Snake.Root            16
210 2016     2    2       C     Dry     Wet   Sep Black.Snake.Root            18
211 2016     2    2       B     Wet     Wet   Sep Black.Snake.Root             2
212 2016     2    1       C Control     Dry   Sep Black.Snake.Root            13
213 2016     2    1       A     Wet     Dry   Sep Black.Snake.Root            46
214 2016     2    1       B     Dry     Dry   Sep 

0 个答案:

没有答案