library(tidyverse)
library(lme4)
library(DT)
# Data prepped for competition indexes
load("D:/Projects/SubalpineTopoGrowth/data/growth_long/subalpine_non_spatial.RData")
df <- subalpine_non_spatial
names(df)
## [1] "id" "Plot" "Spec"
## [4] "dbh4" "annual_ba_cm_2022" "ci_3"
## [7] "dead" "elevation" "slope"
## [10] "aspect" "soil_moisture" "soil_temperature"
## [13] "air_temperature" "relative_humidity" "moisture_class"
df <- df %>%
filter(annual_ba_cm_2022 > 0) %>%
filter(dead == 0)
1.How does soil moisture availability and competition influence subalpine tree growth?
Hypothesis 1: Tree growth will be greater in wetter sites particularly for species that are less tolerant of drought.
Hypothesis 2: Tree growth will be limited by not only soil moisture but an interaction with competition, with trees growth being suppressed in areas of low soil moisture availability and high competition.
DT::datatable(df, class = 'cell-border stripe', rownames = F, filter = 'top',
editable = T, extensions = 'Buttons', options = list(dom = 'Bfrtip',
buttons = c("excel")))
ggplot(data = df) +
geom_boxplot(mapping = aes(y = annual_ba_cm_2022, x = moisture_class, fill = moisture_class)) +
theme_bw() +
ylim(c(0,100)) +
labs(y = "Basal Area Increase (cm^2)",
x = "Moisture Class",
fill = "",
title = "2016 - 2022 Basal Area Increase ~ Moisture Class per Species") +
facet_grid(~Spec)
ggplot(data = df) +
geom_boxplot(mapping = aes(y = annual_ba_cm_2022, x = as.factor(soil_moisture), fill = as.factor(soil_moisture))) +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1)) +
ylim(c(0,100)) +
labs(y = "Basal Area Increase (cm^2)",
x = "Soil Moisture Level",
fill = "",
title = "2016 - 2022 Basal Area Increase ~ Soil Moisture per Species") +
facet_grid(~Spec)
mod_lm <- lm(annual_ba_cm_2022 ~ soil_moisture + Spec, data = df)
summary(mod_lm)
##
## Call:
## lm(formula = annual_ba_cm_2022 ~ soil_moisture + Spec, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.128 -2.722 -1.507 0.960 102.409
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.7243 0.2473 11.015 < 2e-16 ***
## soil_moisture 0.1015 0.0143 7.096 1.59e-12 ***
## SpecPICO -0.4173 0.3244 -1.286 0.1984
## SpecPIEN 1.4724 0.2609 5.644 1.81e-08 ***
## SpecPIFL 1.0854 0.4542 2.390 0.0169 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.197 on 3126 degrees of freedom
## Multiple R-squared: 0.04188, Adjusted R-squared: 0.04066
## F-statistic: 34.16 on 4 and 3126 DF, p-value: < 2.2e-16
Basal Area increases .10 cm^2 per 1 unit increase in soil moisture level. Significant.
Species differ in mean growth from reference (ABLA).
mod_lm_int <- lm(annual_ba_cm_2022 ~ soil_moisture * Spec, data = df)
summary(mod_lm_int)
##
## Call:
## lm(formula = annual_ba_cm_2022 ~ soil_moisture * Spec, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.497 -2.809 -1.261 0.960 102.329
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.99067 0.30109 9.933 < 2e-16 ***
## soil_moisture 0.07824 0.02078 3.764 0.00017 ***
## SpecPICO -3.97049 0.67345 -5.896 4.13e-09 ***
## SpecPIEN 1.15424 0.43195 2.672 0.00758 **
## SpecPIFL 0.87874 0.84351 1.042 0.29760
## soil_moisture:SpecPICO 0.82020 0.13521 6.066 1.47e-09 ***
## soil_moisture:SpecPIEN 0.02743 0.02902 0.945 0.34458
## soil_moisture:SpecPIFL 0.01555 0.08925 0.174 0.86170
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.164 on 3123 degrees of freedom
## Multiple R-squared: 0.05307, Adjusted R-squared: 0.05094
## F-statistic: 25 on 7 and 3123 DF, p-value: < 2.2e-16
mod_lm_comp <- lm(annual_ba_cm_2022 ~ soil_moisture + ci_3 + Spec, data = df)
summary(mod_lm_comp)
##
## Call:
## lm(formula = annual_ba_cm_2022 ~ soil_moisture + ci_3 + Spec,
## data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.859 -2.609 -0.997 0.942 100.579
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.826280 0.276571 21.066 < 2e-16 ***
## soil_moisture 0.095269 0.013424 7.097 1.57e-12 ***
## ci_3 -0.203843 0.009885 -20.621 < 2e-16 ***
## SpecPICO 0.444495 0.307248 1.447 0.14808
## SpecPIEN 0.697858 0.247655 2.818 0.00486 **
## SpecPIFL -0.502045 0.433086 -1.159 0.24645
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.815 on 3125 degrees of freedom
## Multiple R-squared: 0.1566, Adjusted R-squared: 0.1553
## F-statistic: 116.1 on 5 and 3125 DF, p-value: < 2.2e-16
.10 increase in Basal Area per 1 unit increase in soil moisture.
.2 decrease in Basal Area increase per 1 unit increase in competition.
Species differ in significance and amount of increase when compared to reference species (ABLA).
mod_lmer <- lmer(annual_ba_cm_2022 ~ ci_3 + soil_moisture * Spec + dbh4 + (1 | Plot), data = df)
summary(mod_lmer)
## Linear mixed model fit by REML ['lmerMod']
## Formula: annual_ba_cm_2022 ~ ci_3 + soil_moisture * Spec + dbh4 + (1 |
## Plot)
## Data: df
##
## REML criterion at convergence: 19039.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0893 -0.3142 -0.0429 0.2004 17.8692
##
## Random effects:
## Groups Name Variance Std.Dev.
## Plot (Intercept) 1.507 1.228
## Residual 25.236 5.024
## Number of obs: 3131, groups: Plot, 9
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) -1.468227 0.775725 -1.893
## ci_3 0.002937 0.011174 0.263
## soil_moisture -0.014737 0.054077 -0.273
## SpecPICO -4.338846 1.377371 -3.150
## SpecPIEN -0.439076 0.362813 -1.210
## SpecPIFL -5.490205 0.888139 -6.182
## dbh4 0.441940 0.013811 31.999
## soil_moisture:SpecPICO 0.234974 0.194160 1.210
## soil_moisture:SpecPIEN 0.030971 0.023738 1.305
## soil_moisture:SpecPIFL 0.390697 0.093485 4.179
##
## Correlation of Fixed Effects:
## (Intr) ci_3 sl_mst SpPICO SpPIEN SpPIFL dbh4 s_:SPIC s_:SPIE
## ci_3 -0.340
## soil_moistr -0.719 -0.011
## SpecPICO -0.262 -0.036 0.216
## SpecPIEN -0.210 0.022 0.171 0.119
## SpecPIFL -0.119 -0.054 0.134 0.196 0.143
## dbh4 -0.293 0.576 -0.053 -0.087 -0.104 -0.145
## sl_ms:SPICO 0.209 0.033 -0.173 -0.937 -0.012 -0.151 -0.004
## sl_ms:SPIEN 0.175 0.006 -0.224 -0.099 -0.785 -0.127 0.013 0.053
## sl_ms:SPIFL 0.068 0.057 -0.116 -0.159 -0.012 -0.856 0.062 0.155 0.109
This model:
Controls for competition (ci_3)
Allows species-specific responses to soil moisture
Accounts for tree size (dbh4)
Includes plot-level random intercepts (more useful when repeat measures will be included)
Results:
Larger trees put on more basal area increase (not really useful but may help account for size)
PIEN, PIFL, PICO positive response to soil moisture
Competition isn’t significant, most likely diminished due to plot level variations in soil moisture.
lattice::dotplot(ranef(mod_lmer, condVar = TRUE))
## $Plot
mod_lmer_ci_sm <- lmer(annual_ba_cm_2022 ~ ci_3 * soil_moisture + Spec + dbh4 + (1 | Plot), data = df)
summary(mod_lmer_ci_sm)
## Linear mixed model fit by REML ['lmerMod']
## Formula: annual_ba_cm_2022 ~ ci_3 * soil_moisture + Spec + dbh4 + (1 |
## Plot)
## Data: df
##
## REML criterion at convergence: 19047.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0171 -0.3088 -0.0366 0.1792 18.1081
##
## Random effects:
## Groups Name Variance Std.Dev.
## Plot (Intercept) 1.195 1.093
## Residual 25.276 5.028
## Number of obs: 3131, groups: Plot, 9
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) -2.267607 0.695065 -3.262
## ci_3 0.032724 0.014394 2.274
## soil_moisture 0.076502 0.048595 1.574
## SpecPICO -2.531488 0.471768 -5.366
## SpecPIEN -0.188438 0.223319 -0.844
## SpecPIFL -2.217245 0.457090 -4.851
## dbh4 0.431744 0.013868 31.133
## ci_3:soil_moisture -0.003742 0.001039 -3.601
##
## Correlation of Fixed Effects:
## (Intr) ci_3 sl_mst SpPICO SpPIEN SpPIFL dbh4
## ci_3 -0.399
## soil_moistr -0.692 0.181
## SpecPICO -0.190 0.015 0.150
## SpecPIEN -0.142 0.016 0.002 0.325
## SpecPIFL -0.116 0.005 0.060 0.229 0.332
## dbh4 -0.311 0.369 -0.084 -0.263 -0.154 -0.176
## c_3:sl_mstr 0.154 -0.633 -0.288 -0.046 0.020 -0.018 0.117
This model:
Results:
lattice::dotplot(ranef(mod_lmer_ci_sm, condVar = TRUE))
## $Plot