【发布时间】:2021-09-08 20:48:19
【问题描述】:
我正在尝试使用 lmer 和 lmerTest 进行重复测量混合效应测试,但我不确定我是否正确。
我有 6 个地点,每个地点 3 个地块,连续 24 年每年采样一次。我有几个环境和物种变量,但为简单起见,假设我有两个环境变量(深度和温度)和两个物种(物种 1 和物种 2)。我对时间变量、随时间变化或相互作用不感兴趣,因为该系统具有很强的干湿季节性,旱季的影响超过了前一年物种的影响。我不一定每年都有所有变量和地块的数据,有些地块有时没有采样。
问题是相对于环境变量,物种2(捕食者)是否对物种1的种群有任何影响。
在模型中包含年份作为其自身的随机效应以及站点内的图是否合适?
model1 <- lmer(species1 ~ depth + temperature + species2 + (1|year) + (1|site/plot), data=data)
对于这个特定的分析,总共有 435 次观察(情节/年),但我担心它没有适当地进行重复测量。
anova(model1)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
depth 0.0221 0.0221 1 145.75 0.0908 0.7635
temperature 9.0213 9.0213 1 422.19 37.0429 2.596e-09 ***
species2 0.0597 0.0597 1 418.95 0.2450 0.6208
这似乎不对。合并年份是更好的方法,还是我应该包括年份?
如果我排除年份,为什么深度的 DenDF 变化如此剧烈?
model1 <- lmer(species1 ~ depth + temperature + species2 + (1|year) + (1|site/plot), data=data)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
depth 2.599 2.599 1 431.77 7.1096 0.007955 **
temperature 58.788 58.788 1 432.10 160.7955 < 2.2e-16 ***
species2 0.853 0.853 1 429.62 2.3336 0.127343
summary(M1)
Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: species1 ~ depth + temperature + species2 + (1 | site/plot)
Data: data
AIC BIC logLik deviance df.resid
833.4 861.9 -409.7 819.4 428
Scaled residuals:
Min 1Q Median 3Q Max
-2.20675 -0.66119 -0.07051 0.52722 2.99942
Random effects:
Groups Name Variance Std.Dev.
plot:site (Intercept) 0.0003221 0.01795
site (Intercept) 0.2051143 0.45290
Residual 0.3656072 0.60465
Number of obs: 435, groups: plot:site, 24; site, 6
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) -0.538258 0.325072 50.071940 -1.656 0.10401
depth 0.006338 0.002377 431.768539 2.666 0.00796 **
temperature 0.391023 0.030837 432.101095 12.681 < 2e-16 ***
species2 -0.353264 0.231252 429.615226 -1.528 0.12734
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) depth temp
depth -0.316
temperature -0.467 -0.204
specie2 -0.544 0.040 0.007
【问题讨论】:
标签: time-series lme4