2022 Agua Salud LMER Code RStudio
收藏资源简介:
This is an RStudio script for a linear mixed effects model analysis using lmer. This linear mixed effects model was constructed to analyze the relative impacts of soil temperature, soil moisture, forest floor mass and soil organic C on soil CO2 fluxes (see dataset entitled 2022 Agua Salud CO2 Fluxes - Raw Data). First, a full mixed effects model was constructed using soil temperature (T), soil moisture (Moist), forest floor mass (Litter), and soil organic C (SOC) and their two-level interactions as fixed effects with Site as a random effect. Parameter estimates and sums of squares for each term were determined using summary(model) and anova(model) functions for the full model. To investigate the directions of the significant interaction terms identified in the full model, the deltaMethod function from the car package was used to generate transformations of the parameter estimates, resulting in point estimates and standard errors for CO2 flux. Data tables for the interaction plots were generated and plotted in a separate file (see 2022 Agua Salud Interaction Plots Code RStudio).
本脚本为使用lmer函数开展线性混合效应模型分析的RStudio脚本。本线性混合效应模型(linear mixed effects model)旨在分析土壤温度、土壤湿度、枯落物层生物量与土壤有机碳(soil organic C, SOC)对土壤CO₂通量的相对影响(详见题为《2022 Agua Salud CO2 Fluxes - Raw Data》的数据集)。首先,我们构建了完整混合效应模型,以土壤温度(T)、土壤湿度(Moist)、枯落物层生物量(Litter)、土壤有机碳(SOC)及其两两交互项作为固定效应,以样地(Site)作为随机效应。通过summary(model)与anova(model)函数,可获取完整模型各变量的参数估计值与平方和。为探究完整模型中识别出的显著交互项的作用方向,我们调用car包中的deltaMethod函数对参数估计值进行转换,最终得到CO₂通量的点估计值与标准误。交互效应绘图所需的数据表已生成,并在单独文件中完成绘图(详见《2022 Agua Salud Interaction Plots Code RStudio》)。



