Statistical analysis

Litter decomposition

Author

Marcelo Araya-Salas & Andrea Vincent

Published

October 7, 2026

Source code and data found at https://github.com/maRce10/litter_decomposition_EFFEX

Purpose

  • Evaluate role of nutrient availability on litter decomposition

 

Code
# custom function based on gghalves::geom_half_point
geom_half_point <- function(
  mapping = NULL,
  data = NULL,
  side = "l",
  range_scale = 0.4,
  alpha = 1,
  pch = 16,
  size = 1.5,
  transformation = NULL,   # <- absorb but ignore
  ...
) {

  ggplot2::geom_point(
    mapping = mapping,
    data = data,
    alpha = alpha,
    shape = pch,
    size = size,
    position = position_half_jitter(
      width = 0.1,
      height = 0,
      side = side,
      range_scale = range_scale
    ),
    ...
  )
}

position_half_jitter <- function(width = 0.1,
                                 height = 0,
                                 side = "l",
                                 range_scale = 0.4) {

  ggplot2::ggproto(
    NULL, ggplot2::Position,

    compute_panel = function(self, data, params, scales) {

      # apply regular jitter first
      data$x <- data$x + stats::runif(
        nrow(data),
        -width / 2,
        width / 2
      )

      # shift to one side
      shift <- if (side %in% c("l", "left")) {
        -range_scale / 2
      } else {
        range_scale / 2
      }

      data$x <- data$x + shift

      data
    }
  )
}

cols <- viridis(10, alpha = 0.7)
fill_color <- viridis(10)[7]

# brms models
chains <- 4
iters <- 4000
prior <- c(prior(normal(0, 10), "b"), prior(normal(0, 50), "Intercept"),
    prior(student_t(3, 0, 20), "sd"))

# set ggplot2 them
ggplot2::theme_set(theme_classic(base_size = 20))


# standard error
se <- function(x) sd(x) / sqrt(length(x))

1 Site characteristics

Code
soil <- read.csv("./data/raw/soils_effex.csv")
Code
preds <- names(soil)[7:17]

soil$pool.n <- factor(soil$pool.n)

levels(soil$pool.n) <- c("no.n", "n")

for (i in preds) {
    form <- as.formula(paste(i, "~ pool.n + pool.p"))
    print(i)

    mod <- brm(form, data = soil, chains = chains, family = gaussian(),
        iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
            max_treedepth = 15), cores = chains, prior = c(prior(normal(0,
            10), "b"), prior(normal(0, 50), "Intercept")), file = paste0("./data/processed/",
            i, "_pooled_model"), file_refit = "on_change")
}
[1] "ph.h2o"
[1] "resin.p"
[1] "resin.p.no.outlier"
[1] "tc.g.kg.18"
[1] "tn.g.kg.18"
[1] "tp.g.kg.18"
[1] "tp.g.kg.18.no.outlier"
[1] "CN"
[1] "CP.no.outlier"
[1] "NP.no.outlier"
[1] "litter.mg.C.ha.yr"
Code
preds <- names(soil)[7:17]

for (i in preds) {
    extended_summary(read.file = paste0("./data/processed/", i, "_pooled_model.rds"),
        gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
        remove.intercepts = TRUE)
}

1.1 ph.h2o_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 ph.h2o ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 57373.74 48309 1664004957
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.084 -0.006 0.175 1 59038.57 48309.0
pool.pp 0.104 0.015 0.194 1 57373.74 48318.2

1.2 resin.p_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 resin.p ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 30.9) 40000 4 1 20000 0 (0%) 0 57961.13 52214.16 1531674567
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 1.930 -12.400 16.063 1 64784.65 53121.93
pool.pp 16.442 0.626 31.023 1 57961.13 52214.16

1.3 resin.p.no.outlier_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 resin.p.no.outlier ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 27) 40000 4 1 20000 0 (0%) 0 44847.3 46327.93 2096696539
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.203 -13.264 13.647 1 59378.99 52345.57
pool.pp 21.152 5.045 35.404 1 44847.30 46327.93

1.4 tc.g.kg.18_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 tc.g.kg.18 ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 4.5) 40000 4 1 20000 0 (0%) 0 63121.58 49927.59 1374186359
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -2.342 -6.678 2.002 1 63521.49 49927.59
pool.pp 0.285 -4.121 4.627 1 63121.58 50046.02

1.5 tn.g.kg.18_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 tn.g.kg.18 ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 58531.45 46374.4 772312416
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.150 -0.565 0.267 1 59926.93 49974.06
pool.pp 0.026 -0.392 0.440 1 58531.45 46374.40

1.6 tp.g.kg.18_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 tp.g.kg.18 ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 565.6) 40000 4 1 20000 0 (0%) 0 68442.12 53031.23 532966702
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.003 -19.623 19.494 1 68442.12 53031.23
pool.pp 0.045 -19.340 19.697 1 69481.22 54683.43

1.7 tp.g.kg.18.no.outlier_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 tp.g.kg.18.no.outlier ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 478.9) 40000 4 1 20000 0 (0%) 0 69342.37 53547.36 1716433649
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.075 -19.547 19.574 1 69342.37 53547.36
pool.pp 0.078 -19.538 19.763 1 70066.34 56200.05

1.8 CN_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 CN ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 55930.11 48759.38 675162061
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.157 -0.633 0.318 1 55930.11 48759.38
pool.pp -0.015 -0.488 0.459 1 58599.54 50110.82

1.9 CP.no.outlier_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 CP.no.outlier ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 10.7) 40000 4 1 20000 0 (0%) 0 62823.22 49458.11 257447415
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -2.136 -9.002 4.745 1 62823.22 49552.82
pool.pp -5.966 -12.841 1.029 1 63184.44 49458.11

1.10 NP.no.outlier_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 NP.no.outlier ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 59651.87 47775.52 2143149156
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.175 -0.861 0.508 1 62165.12 50442.73
pool.pp -0.593 -1.292 0.105 1 59651.87 47775.52

1.11 litter.mg.C.ha.yr_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 litter.mg.C.ha.yr ~ pool.n + pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 56795.19 48364.42 308107221
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.420 -0.936 1.779 1 56795.19 49532.70
pool.pp 0.235 -1.112 1.568 1 57467.82 48364.42

1.12 Microbial CNP

Code
soil_master <- read.csv("./data/raw/strimastersoils.csv")

2 Nutrient change

2.1 Nitrogen

Content

Code
nutr <- read.csv("./data/raw/litter-nutrients-mas.csv")

nutr$plot.f <- as.factor(nutr$plot)

nutr$days.sc <- scale(nutr$days)

nutr$litter.n.content.prop.initial <- nutr$litter.n.content.perc.initial/100

nutr$litter.n.content.prop.initial <- ifelse(nutr$litter.n.content.prop.initial >=
    1, 0.99999, nutr$litter.n.content.prop.initial)

# remove plot 9
sub.nutr <- nutr[nutr$plot != 9, ]

agg_n <- aggregate(litter.n.content.perc.initial ~ colecta + treat +
    days, nutr, mean)

agg_n$sd <- aggregate(litter.n.content.perc.initial ~ colecta + treat +
    days, nutr, sd)$litter.n.content.perc.initial

agg_n$se <- aggregate(litter.n.content.perc.initial ~ colecta + treat +
    days, nutr, se)$litter.n.content.perc.initial

agg_n$treat <- factor(agg_n$treat, levels = c("C", "N", "P", "NP"))

pd <- position_dodge(15)

ggplot(agg_n, aes(x = days, y = litter.n.content.perc.initial, color = treat)) +
    geom_point(size = 2, position = pd) + geom_errorbar(aes(ymax = litter.n.content.perc.initial +
    se, ymin = litter.n.content.perc.initial - se), width = 0, position = pd) +
    geom_line(size = 1.2, position = pd) + scale_color_viridis_d(alpha = 0.5) +
    labs(x = "Time (days)", y = "Litter N content (% initial)", color = "Treatment") +
    scale_x_continuous(breaks = unique(agg_n$days), labels = unique(agg_n$days)) +
    theme(legend.position = c(0.9, 0.8))

Code
ggsave("./output/Litter_N_content.tiff", dpi = 300)

Download image

Code
fit.n <- brm(litter.n.content.prop.initial ~ treat * days.sc + (1 |
    plot.f), data = nutr, chains = chains, cores = chains, family = Beta(link = "logit"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), prior = prior, file = "./data/processed/litter.n.content.rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/litter.n.content.rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.2 litter.n.content.rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 litter.n.content.prop.initial ~ treat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 18081.47 32126.68 133104208
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN -1.647 -3.081 -0.490 1 18081.47 32126.68
treatNP -0.014 -1.128 1.103 1 29901.36 37700.39
treatP -0.018 -1.129 1.108 1 28552.94 36460.17
days.sc -0.582 -0.921 -0.270 1 32211.71 40133.55
treatN:days.sc -0.395 -0.839 0.065 1 35865.04 46297.12
treatNP:days.sc 0.039 -0.380 0.464 1 41161.70 46347.13
treatP:days.sc 0.044 -0.374 0.473 1 42814.27 47993.03

Concentration

Code
agg_conc_n <- aggregate(perc.n ~ colecta + treat + days, nutr, mean)

agg_conc_n$sd <- aggregate(perc.n ~ colecta + treat + days, nutr,
    sd)$perc.n

agg_conc_n$se <- aggregate(perc.n ~ colecta + treat + days, nutr,
    se)$perc.n

agg_conc_n$treat <- factor(agg_conc_n$treat, levels = c("C", "N",
    "P", "NP"))

pd <- position_dodge(15)

ggplot(agg_conc_n, aes(x = days, y = perc.n, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = perc.n + se, ymin = perc.n -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5) + labs(x = "Time (days)", y = "Litter N concentration (%)",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_conc_n$days),
    labels = unique(agg_conc_n$days)) + theme(legend.position = c(0.3,
    0.8))

Code
ggsave("./output/Litter_N_concentration.tiff", dpi = 300)

Download image

Code
nutr$prop.n <- nutr$perc.n/100

fit.perc.n <- brm(prop.n ~ treat * days.sc + (1 | plot.f), data = nutr,
    chains = chains, core = chains, family = Beta(link = "logit"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), prior = prior, file = "./data/processed/litter.n.perc_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/litter.n.perc_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.3 litter.n.perc_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.n ~ treat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 46327.62 54558.21 1601365024
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN -0.094 -0.228 0.041 1 69078.66 60189.35
treatNP -0.049 -0.182 0.083 1 67281.08 58311.55
treatP -0.023 -0.155 0.110 1 67070.15 57430.23
days.sc 0.134 0.045 0.223 1 46327.62 54558.21
treatN:days.sc -0.076 -0.199 0.047 1 56083.61 60964.21
treatNP:days.sc -0.031 -0.154 0.091 1 55843.66 60673.10
treatP:days.sc -0.012 -0.136 0.110 1 54849.39 59142.62

Proportion N

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")

sub.nutr$prop.n <- sub.nutr$perc.n/100

sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")

fit_np_treat_by_rem_leave <- brm(prop.n ~ pool.n * days.sc + pool.p *
    days.sc + (1 | plot), data = sub.nutr, chains = chains, iter = iters,
    backend = "cmdstanr", family = Beta(link = "logit"), control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/n_perc_by_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/n_perc_by_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.4 n_perc_by_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.n ~ pool.n * days.sc + pool.p * days.sc + (1 | plot) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 62377.06 57322.69 420055554
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.070 -0.028 0.168 1 86022.68 58376.02
days.sc 0.069 -0.006 0.144 1 62377.06 57547.89
pool.pp 0.022 -0.077 0.120 1 84005.63 57322.69
pool.nn:days.sc 0.051 -0.039 0.141 1 77790.52 60835.30
days.sc:pool.pp 0.022 -0.067 0.112 1 76754.31 59758.92

Content N

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")

sub.nutr$prop.n <- sub.nutr$perc.n/100

sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")



fit_np_treat_by_rem_leave <- brm(litter.n.content.prop.initial ~ pool.n *
    days.sc + pool.p * days.sc + (1 | plot), data = sub.nutr, chains = chains,
    family = Beta(link = "logit"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/n_content_by_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/n_content_by_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.5 n_content_by_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 litter.n.content.prop.initial ~ pool.n * days.sc + pool.p * days.sc + (1 | plot) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 16267.3 24934.47 703291052
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.761 0.040 1.727 1 18141.08 27927.42
days.sc -0.868 -1.144 -0.600 1 51460.14 50274.93
pool.pp 0.776 0.050 1.765 1 16267.30 24934.47
pool.nn:days.sc 0.130 -0.203 0.457 1 49902.49 54629.89
days.sc:pool.pp 0.200 -0.131 0.531 1 47341.92 53863.66

2.6 Phosphorus

Content

Code
nutr$litter.p.content.prop.initial <- nutr$litter.p.content.perc.initial/100

# excluding plot 9
agg_p <- aggregate(litter.p.content.perc.initial ~ colecta + treat +
    days, sub.nutr, mean)

agg_p$sd <- aggregate(litter.p.content.perc.initial ~ colecta + treat +
    days, sub.nutr, sd)$litter.p.content.perc.initial

agg_p$se <- aggregate(litter.p.content.perc.initial ~ colecta + treat +
    days, sub.nutr, se)$litter.p.content.perc.initial


agg_p$treat <- factor(agg_p$treat, levels = c("C", "N", "P", "NP"))


pd <- position_dodge(15)

ggplot(agg_p, aes(x = days, y = litter.p.content.perc.initial, color = treat)) +
    geom_point(size = 2, position = pd) + geom_errorbar(aes(ymax = litter.p.content.perc.initial +
    se, ymin = litter.p.content.perc.initial - se), width = 0, position = pd) +
    geom_line(size = 1.2, position = pd) + scale_color_viridis_d(alpha = 0.5) +
    labs(x = "Time (days)", y = "Litter P content (% initial)", color = "Treatment") +
    scale_x_continuous(breaks = unique(agg_p$days), labels = unique(agg_p$days)) +
    theme(legend.position = c(0.9, 0.8))

Code
ggsave("./output/Litter_P_content.tiff", dpi = 300)

Download image

Code
fit.p <- brm(litter.p.content.prop.initial ~ treat * days.sc + (1 |
    plot.f), data = nutr[nutr$litter.p.content.prop.initial < 1, ],
    chains = chains, prior = prior, cores = chains, iter = iters,
    backend = "cmdstanr", family = Beta(link = "logit"), control = list(adapt_delta = 0.99,
        max_treedepth = 15), file = "./data/processed/litter.p.content.rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/litter.p.content.rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.7 litter.p.content.rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 litter.p.content.prop.initial ~ treat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 30308.33 33820.81 387739083
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN -0.431 -1.071 0.199 1 31830.65 36162.62
treatNP 0.008 -0.630 0.628 1 30308.33 35587.97
treatP 0.406 -0.208 1.073 1 31464.41 33820.81
days.sc -0.625 -0.917 -0.351 1 37291.72 44954.33
treatN:days.sc -0.053 -0.451 0.346 1 45013.77 54258.39
treatNP:days.sc 0.131 -0.242 0.510 1 43893.72 51420.40
treatP:days.sc -0.011 -0.411 0.389 1 46067.88 54903.18

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")

sub.nutr$prop.n <- sub.nutr$perc.n/100


sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")

sub.nutr$litter.p.content.prop.initial <- sub.nutr$litter.p.content.perc.initial/100

fit.p <- brm(litter.p.content.prop.initial ~ pool.n * days.sc + pool.p *
    days.sc + (1 | plot.f), data = sub.nutr[sub.nutr$litter.p.content.prop.initial <
    1, ], family = Beta(link = "logit"), chains = chains, prior = prior,
    cores = chains, iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), file = "./data/processed/litter.p.content.perc.initial_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/litter.p.content.perc.initial_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.8 litter.p.content.perc.initial_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 litter.p.content.prop.initial ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 40000 4 1 20000 0 (0%) 0 50677.33 45371.33 1725267264
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.288 -0.050 0.634 1 50677.33 45371.33
days.sc -0.611 -0.834 -0.393 1 56026.00 56245.54
pool.pp 0.309 -0.030 0.643 1 52937.35 48680.19
pool.nn:days.sc -0.090 -0.352 0.167 1 74581.88 60974.39
days.sc:pool.pp 0.066 -0.191 0.323 1 71780.66 59901.70

Concentration

Code
agg_conc_p <- aggregate(perc.p ~ colecta + treat + days, sub.nutr,
    mean)

agg_conc_p$sd <- aggregate(perc.p ~ colecta + treat + days, sub.nutr,
    sd)$perc.p

agg_conc_p$se <- aggregate(perc.p ~ colecta + treat + days, sub.nutr,
    se)$perc.p

agg_conc_p$treat <- factor(agg_conc_p$treat, levels = c("C", "N",
    "P", "NP"))

pd <- position_dodge(15)

ggplot(agg_conc_p, aes(x = days, y = perc.p, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = perc.p + se, ymin = perc.p -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5) + labs(x = "Time (days)", y = "Litter P concentration (%)",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_conc_p$days),
    labels = unique(agg_conc_p$days)) + theme(legend.position = c(0.9,
    0.8))

Code
ggsave("./output/Litter_P_concentration.tiff", dpi = 300)

Download image

Code
# convert to proportions to use beta distribution
sub.nutr$prop.p <- sub.nutr$perc.p/100

fit.perc.p <- brm(prop.p ~ treat * days.sc + (1 | plot.f), data = sub.nutr,
    chains = chains, cores = chains, family = Beta(), iter = iters,
    backend = "cmdstanr", control = list(adapt_delta = 0.99, max_treedepth = 15),
    prior = prior, file = "./data/processed/litter.p.perc_model",
    file_refit = "on_change")
Running MCMC with 4 parallel chains...

Chain 1 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 1 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 1 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 2 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 2 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 3 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 4 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 1 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 1 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 2 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 3 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 3 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 1 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 1 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 2 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 2 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 3 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 3 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 4 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 1 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 1 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 1 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 2 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 2 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 2 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 3 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 3 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 4 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 4 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 1 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 1 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 2 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 2 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 3 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 3 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 4 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 4 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 4 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 1 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 1 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 2 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 2 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 2 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 3 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 3 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 3 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 4 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 4 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 1 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 1 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 1 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 2 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 2 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 3 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 3 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 4 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 4 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 1 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 1 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 2 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 2 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 3 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 3 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 4 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 4 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 4 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 1 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 1 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 1 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 2 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 2 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 3 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 3 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 4 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 4 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 1 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 2 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 2 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 2 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 3 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 3 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 4 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 4 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 1 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 1 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 2 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 2 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 3 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 3 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 3 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 4 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 4 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 1 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 1 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 2 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 2 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 3 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 3 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 4 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 4 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 4 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 1 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 1 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 2 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 2 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 3 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 3 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 3 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 4 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 1 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 1 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 2 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 2 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 3 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 3 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 4 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 4 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 1 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 1 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 2 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 2 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 3 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 3 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 4 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 1 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 1 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 2 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 2 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 3 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 3 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 4 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 4 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 1 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 1 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 2 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 2 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 3 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 3 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 4 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 4 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 1 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 1 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 2 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 2 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 2 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 3 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 3 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 4 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 1 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 1 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 2 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 2 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 3 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 3 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 4 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 4 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 1 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 2 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 3 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 3 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 4 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 1 finished in 2.2 seconds.
Chain 2 finished in 2.1 seconds.
Chain 3 finished in 2.1 seconds.
Chain 4 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 4 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 4 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 4 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 4 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 4 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 4 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 4 finished in 2.5 seconds.

All 4 chains finished successfully.
Mean chain execution time: 2.2 seconds.
Total execution time: 2.8 seconds.
Code
extended_summary(read.file = "./data/processed/litter.p.perc_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.9 litter.p.perc_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.p ~ treat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3767.728 5094.179 753339504
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN -0.109 -0.594 0.364 1 6105.865 6017.442
treatNP 0.027 -0.447 0.502 1.001 5840.603 5539.745
treatP 0.070 -0.441 0.588 1 5620.752 5764.517
days.sc -0.042 -0.381 0.289 1.001 3767.728 5094.179
treatN:days.sc -0.014 -0.487 0.439 1 4876.616 5868.129
treatNP:days.sc 0.037 -0.419 0.499 1.001 4587.775 5135.317
treatP:days.sc 0.028 -0.460 0.513 1.001 4681.095 5628.621

Pooled P

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")

sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")


fit.perc.p <- brm(prop.p ~ pool.n * days.sc + pool.p * days.sc + (1 |
    plot.f), data = sub.nutr, chains = chains, cores = chains, family = Beta(),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), prior = prior, file = "./data/processed/litter.p.perc_model",
    file_refit = "on_change")
Running MCMC with 4 parallel chains...

Chain 1 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 1 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 1 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 2 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 2 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 3 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 4 Iteration:    1 / 4000 [  0%]  (Warmup) 
Chain 1 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 2 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 2 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 3 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 3 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 3 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 4 Iteration:  100 / 4000 [  2%]  (Warmup) 
Chain 1 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 1 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 2 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 2 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 3 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 3 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 4 Iteration:  200 / 4000 [  5%]  (Warmup) 
Chain 4 Iteration:  300 / 4000 [  7%]  (Warmup) 
Chain 1 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 1 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 2 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 2 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 2 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 3 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 3 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 4 Iteration:  400 / 4000 [ 10%]  (Warmup) 
Chain 1 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 1 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 2 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 2 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 3 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 3 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 4 Iteration:  500 / 4000 [ 12%]  (Warmup) 
Chain 4 Iteration:  600 / 4000 [ 15%]  (Warmup) 
Chain 4 Iteration:  700 / 4000 [ 17%]  (Warmup) 
Chain 1 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 1 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 1 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 2 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 2 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 2 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 3 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 3 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 4 Iteration:  800 / 4000 [ 20%]  (Warmup) 
Chain 4 Iteration:  900 / 4000 [ 22%]  (Warmup) 
Chain 1 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 1 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 2 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 2 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 3 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 3 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 3 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 4 Iteration: 1000 / 4000 [ 25%]  (Warmup) 
Chain 4 Iteration: 1100 / 4000 [ 27%]  (Warmup) 
Chain 4 Iteration: 1200 / 4000 [ 30%]  (Warmup) 
Chain 1 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 1 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 2 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 2 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 3 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 3 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 4 Iteration: 1300 / 4000 [ 32%]  (Warmup) 
Chain 4 Iteration: 1400 / 4000 [ 35%]  (Warmup) 
Chain 1 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 1 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 1 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 2 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 2 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 2 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 2 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 3 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 3 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 4 Iteration: 1500 / 4000 [ 37%]  (Warmup) 
Chain 4 Iteration: 1600 / 4000 [ 40%]  (Warmup) 
Chain 1 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 1 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 2 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 2 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 3 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 3 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 3 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 4 Iteration: 1700 / 4000 [ 42%]  (Warmup) 
Chain 4 Iteration: 1800 / 4000 [ 45%]  (Warmup) 
Chain 1 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 1 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 1 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 2 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 2 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 3 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 3 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 4 Iteration: 1900 / 4000 [ 47%]  (Warmup) 
Chain 4 Iteration: 2000 / 4000 [ 50%]  (Warmup) 
Chain 4 Iteration: 2001 / 4000 [ 50%]  (Sampling) 
Chain 1 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 1 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 2 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 2 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 2 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 3 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 3 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 3 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 4 Iteration: 2100 / 4000 [ 52%]  (Sampling) 
Chain 4 Iteration: 2200 / 4000 [ 55%]  (Sampling) 
Chain 1 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 1 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 2 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 2 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 3 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 3 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 4 Iteration: 2300 / 4000 [ 57%]  (Sampling) 
Chain 4 Iteration: 2400 / 4000 [ 60%]  (Sampling) 
Chain 1 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 1 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 2 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 2 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 3 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 3 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 4 Iteration: 2500 / 4000 [ 62%]  (Sampling) 
Chain 4 Iteration: 2600 / 4000 [ 65%]  (Sampling) 
Chain 1 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 1 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 2 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 2 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 2 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 3 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 3 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 4 Iteration: 2700 / 4000 [ 67%]  (Sampling) 
Chain 4 Iteration: 2800 / 4000 [ 70%]  (Sampling) 
Chain 4 Iteration: 2900 / 4000 [ 72%]  (Sampling) 
Chain 1 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 1 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 2 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 2 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 3 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 3 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 4 Iteration: 3000 / 4000 [ 75%]  (Sampling) 
Chain 4 Iteration: 3100 / 4000 [ 77%]  (Sampling) 
Chain 1 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 1 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 1 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 2 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 2 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 3 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 3 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 3 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 4 Iteration: 3200 / 4000 [ 80%]  (Sampling) 
Chain 4 Iteration: 3300 / 4000 [ 82%]  (Sampling) 
Chain 1 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 1 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 2 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 2 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 3 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 3 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 4 Iteration: 3400 / 4000 [ 85%]  (Sampling) 
Chain 4 Iteration: 3500 / 4000 [ 87%]  (Sampling) 
Chain 2 finished in 1.9 seconds.
Chain 1 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 1 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 3 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 3 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 4 Iteration: 3600 / 4000 [ 90%]  (Sampling) 
Chain 4 Iteration: 3700 / 4000 [ 92%]  (Sampling) 
Chain 1 finished in 2.1 seconds.
Chain 3 finished in 2.0 seconds.
Chain 4 Iteration: 3800 / 4000 [ 95%]  (Sampling) 
Chain 4 Iteration: 3900 / 4000 [ 97%]  (Sampling) 
Chain 4 Iteration: 4000 / 4000 [100%]  (Sampling) 
Chain 4 finished in 2.1 seconds.

All 4 chains finished successfully.
Mean chain execution time: 2.0 seconds.
Total execution time: 2.3 seconds.
Code
extended_summary(read.file = "./data/processed/litter.p.perc_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.10 litter.p.perc_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.p ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 6714.33 5699.813 610960379
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.075 -0.267 0.411 1 11140.258 6086.529
days.sc -0.053 -0.338 0.221 1.001 6714.330 5699.813
pool.pp 0.110 -0.228 0.456 1.001 9777.749 5940.193
pool.nn:days.sc 0.003 -0.318 0.320 1 8669.449 5835.398
days.sc:pool.pp 0.045 -0.275 0.362 1 8200.302 6405.339

Takeaways

  • Litter P content is significantly lower in plus N treatment plots than in control plot, after accounting for variation explained by time

 

2.11 Remaining litter

Download image

Download image

Code
fit <- brm(prop.litter.rem ~ trat * days.sc + (1 | plot.f), data = dat,
    chains = chains, family = Beta(), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/prop.litter.rem_model",
    file_refit = "on_change")

# dat$days.fc <- as.numeric(as.factor(dat$days)) # monotonic
# effect of time fit_mo <- brm(prop.litter.rem ~ trat *
# mo(days.fc) + (1 | plot.f), data = dat, chains = chains,
# family = Beta(), iter = iters, backend = 'cmdstanr', control =
# list(adapt_delta=0.99, max_treedepth=15), cores = chains,
# prior = prior, file =
# './data/processed/prop.litter.rem_model_monotonic', file_refit
# = 'on_change')
Code
extended_summary(read.file = "./data/processed/prop.litter.rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.12 prop.litter.rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.litter.rem ~ trat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3388.029 4007.676 66280260
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
tratN -0.037 -0.196 0.130 1.001 4596.339 4969.178
tratNP 0.075 -0.086 0.236 1.001 4336.478 4007.676
tratP 0.033 -0.133 0.196 1.001 4437.304 4973.110
days.sc -0.684 -0.799 -0.572 1.001 3388.029 4840.200
tratN:days.sc -0.047 -0.206 0.110 1 4430.732 5698.304
tratNP:days.sc 0.107 -0.046 0.263 1.001 4302.938 4835.591
tratP:days.sc 0.057 -0.094 0.205 1.001 4319.401 5261.304

Code
dat$pool.n <- factor(dat$pool.n)

levels(dat$pool.n) <- c("no.n", "n")

fit <- brm(prop.litter.rem ~ pool.n * days.sc + pool.p * days.sc +
    (1 | plot.f), data = dat, chains = chains, family = Beta(), iter = iters,
    backend = "cmdstanr", control = list(adapt_delta = 0.99, max_treedepth = 15),
    cores = chains, prior = prior, file = "./data/processed/prop.litter.rem_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/prop.litter.rem_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.13 prop.litter.rem_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.litter.rem ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 5542.892 4869.795 363855436
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.003 -0.114 0.111 1 7875.035 4869.795
days.sc -0.706 -0.800 -0.614 1.001 5542.892 5681.337
pool.pp 0.072 -0.039 0.176 1.002 7495.119 5593.453
pool.nn:days.sc -0.007 -0.113 0.101 1 7646.683 6173.889
days.sc:pool.pp 0.108 -0.001 0.216 1.002 7165.537 6100.149

2.14 Remaining wood

Download image

 

Code
dat$prop.wood.rem <- dat$perc.wood.rem/100

fit2 <- brm(prop.wood.rem ~ trat * days.sc + (1 | plot.f), data = dat,
    chains = chains, family = Beta(), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/prop.wood.rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/prop.wood.rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.15 prop.wood.rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.wood.rem ~ trat * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3758.326 5028.295 1274751124
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
tratN 0.119 -0.133 0.368 1.001 5357.250 5102.093
tratNP 0.254 0.012 0.496 1.001 4983.285 5409.023
tratP 0.199 -0.042 0.439 1 5004.227 5167.967
days.sc -0.909 -1.089 -0.733 1.001 3758.326 5028.295
tratN:days.sc -0.007 -0.243 0.231 1 4382.628 5358.099
tratNP:days.sc 0.096 -0.137 0.330 1 4448.839 5725.949
tratP:days.sc 0.174 -0.059 0.412 1.001 4612.941 5588.199

Code
dat$prop.wood.rem <- dat$perc.wood.rem/100

dat$pool.n <- factor(dat$pool.n)

levels(dat$pool.n) <- c("no.n", "n")

fit2 <- brm(prop.wood.rem ~ pool.n * days.sc + pool.p * days.sc +
    (1 | plot.f), data = dat, chains = chains, family = Beta(), iter = iters,
    backend = "cmdstanr", control = list(adapt_delta = 0.99, max_treedepth = 15),
    cores = chains, prior = prior, file = "./data/processed/prop.wood.rem_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/prop.wood.rem_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

2.16 prop.wood.rem_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.wood.rem ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 5440.608 5150.452 1396899651
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.084 -0.249 0.090 1.001 6777.644 5784.736
days.sc -0.933 -1.077 -0.791 1 5440.608 5150.452
pool.pp 0.165 -0.006 0.334 1.001 6810.669 5385.862
pool.nn:days.sc 0.047 -0.113 0.204 1 7100.774 6250.441
days.sc:pool.pp 0.137 -0.024 0.297 1 6246.813 5793.266

3 K

3.1 Litter

Correlation between Silvia’s and Andrea’s K

Code
k_vals <- read.csv("./data/raw/k-values-corr.csv")
names(k_vals)[names(k_vals) %in% c("k.sil.litt.corr", "k.sil.wood.corr")] <- c("k.sil.litt",
    "k.sil.wood")

k_vals <- k_vals[complete.cases(k_vals), ]

Comparing all treatments vs control

Code
agg_kvals <- aggregate(k.sil.litt ~ Treatment, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.litt ~ Treatment, k_vals, se)$k.sil.litt
agg_kvals$sd <- aggregate(k.sil.litt ~ Treatment, k_vals, sd)$k.sil.litt
agg_kvals$n <- aggregate(k.sil.litt ~ Treatment, k_vals, length)$k.sil.litt
agg_kvals$treat <- factor(agg_kvals$Treatment, levels = c("C", "N", "P", "NP"))
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 

# composed box plot
ggplot(k_vals, aes(x = Treatment, y = k.sil.litt)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the right
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
   labs(y = "Decomposition constant (k)") +
  # ylim(c(-0.39, 0.145)) +
  geom_text(data = agg_kvals, aes(y = rep(0.4, nrow(agg_kvals)), x = Treatment, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1)) +
    scale_x_discrete(labels=c("C" = "Control", "N" = "+N",
                              "NP" = "+NP", "P" = "+P"))

Code
ggsave("./output/litter_decomposition_k_by_treatment.tiff", dpi = 300)

Download image

Code
fit_k.litter <- brm(k.sil.litt ~ Treatment + (1 | idplot), data = k_vals,
    chains = chains, family = gaussian(), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_litter_model", file_refit = "on_change")
Code
extended_summary(gsub.pattern = "b_treatment|b_", gsub.replacement = "",
    highlight = TRUE, remove.intercepts = TRUE, read.file = "./data/processed/k_litter_model.rds")

3.2 k_litter_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.litt ~ Treatment + (1 | idplot) gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 2882.884 3444.812 2009189613
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
TreatmentN 0.227 -0.206 0.665 1.001 2882.884 3677.504
TreatmentNP -0.167 -0.608 0.280 1.001 3151.593 3511.361
TreatmentP -0.041 -0.477 0.399 1.001 3032.448 3444.812

pooled N and P

Code
k_vals$pool.p <- ifelse(k_vals$Treatment %in% c("P", "NP"), "p", "no.p")
k_vals$pool.n <- ifelse(k_vals$Treatment %in% c("N", "NP"), "n", "no.n")

k_vals$pool.n <- factor(k_vals$pool.n)

levels(k_vals$pool.n) <- c("no.n", "n")

fit_k.litter <- brm(k.sil.litt ~ pool.p + pool.n + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_litter_pooled_model",
    file_refit = "on_change")
Code
extended_summary(gsub.pattern = "b_treatment|b_", gsub.replacement = "",
    highlight = TRUE, remove.intercepts = TRUE, read.file = "./data/processed/k_litter_pooled_model.rds")

3.3 k_litter_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.litt ~ pool.p + pool.n + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4406.077 4016.48 593318850
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.pp -0.130 -0.312 0.048 1 4737.540 4016.480
pool.nn -0.018 -0.199 0.165 1.002 4406.077 4140.404

Phosphorus vs no-phosphorus

Code
fit_k.litter.p.np <- brm(k.sil.litt ~ p.treat + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    , control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_litter_p_nop_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/k_litter_p_nop_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

3.4 k_litter_p_nop_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.litt ~ p.treat + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5957.587 4350.249 1331658029
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
p.treatwith.p -0.131 -0.303 0.033 1 5957.587 4350.249

Code
agg_kvals <- aggregate(k.sil.litt ~ p.treat, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.litt ~ p.treat, k_vals, se)$k.sil.litt
agg_kvals$sd <- aggregate(k.sil.litt ~ p.treat, k_vals, sd)$k.sil.litt
agg_kvals$p.treat <- factor(agg_kvals$p.treat, labels = c("No P", "P"))
agg_kvals$n <- aggregate(k.sil.litt ~ p.treat, k_vals, length)$k.sil.litt
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 

k_vals$p.treat <- ifelse(k_vals$p.treat == "no.p", "No P", "P")
k_vals$p.treat <- factor(k_vals$p.treat)


# composed box plot
rn_p_litter <- ggplot(k_vals, aes(x = p.treat, y = k.sil.litt)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = p.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P"))

rn_p_litter

Code
ggsave("./output/litter_phosphorus_decomposition_k.tiff", dpi = 300)

Nitrogen vs no-nitrogen

Code
fit_k.litter.n.nn <- brm(k.sil.litt ~ n.treat + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_litter_n_no_n_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/k_litter_n_no_n_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

3.5 k_litter_n_no_n_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.litt ~ n.treat + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 3645.985 4105.991 414529581
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
n.treatwith.n 0.019 -0.175 0.205 1.001 3645.985 4105.991

Code
agg_kvals <- aggregate(k.sil.litt ~ n.treat, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.litt ~ n.treat, k_vals, se)$k.sil.litt
agg_kvals$sd <- aggregate(k.sil.litt ~ n.treat, k_vals, sd)$k.sil.litt
agg_kvals$n.treat <- factor(agg_kvals$n.treat, labels = c("No N", "N"))
agg_kvals$n <- aggregate(k.sil.litt ~ n.treat, k_vals, length)$k.sil.litt
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 
k_vals$n.treat <- factor(k_vals$n.treat, labels = c("No N", "N"))

# composed box plot
rn_n_litter <- ggplot(k_vals, aes(x = n.treat, y = k.sil.litt)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = n.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P"))

rn_n_litter

Code
ggsave("./output/litter_nitrogen_decomposition_k.tiff", dpi = 300)

3.6 Wood

Comparing all treatments vs control

Code
agg_kvals <- aggregate(k.sil.wood ~ Treatment, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.wood ~ Treatment, k_vals, se)$k.sil.wood
agg_kvals$sd <- aggregate(k.sil.wood ~ Treatment, k_vals, sd)$k.sil.wood
agg_kvals$n <- aggregate(k.sil.wood ~ Treatment, k_vals, length)$k.sil.wood
agg_kvals$treat <- factor(agg_kvals$Treatment, levels = c("C", "N", "P", "NP"))
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 

# composed box plot
ggplot(k_vals, aes(x = Treatment, y = k.sil.wood)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
   labs(y = "Decomposition constant (k)") +
  # ylim(c(-0.39, 0.145)) +
  geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = Treatment, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1)) +
    scale_x_discrete(labels=c("C" = "Control", "N" = "+N",
                              "NP" = "+NP", "P" = "+P"))

Code
ggsave("./output/wood_decomposition_k_by_treatment.tiff", dpi = 300)

Download image

Code
fit_k.wood.p.treat <- brm(k.sil.wood ~ Treatment + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = iters *
        2, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/k_wood_treatment_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/k_wood_treatment_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

3.7 k_wood_treatment_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.wood ~ Treatment + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 8000 4 1 4000 0 (0%) 0 7967.681 8822.928 809966136
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
TreatmentN 0.001 -0.311 0.310 1.001 8358.635 9436.277
TreatmentNP -0.220 -0.532 0.087 1 8682.079 8822.928
TreatmentP -0.189 -0.501 0.116 1 7967.681 8947.802

pooled N and P

Code
k_vals$pool.p <- ifelse(k_vals$Treatment %in% c("P", "NP"), "p", "no.p")
k_vals$pool.n <- ifelse(k_vals$Treatment %in% c("N", "NP"), "n", "no.n")

k_vals$pool.n <- factor(k_vals$pool.n)

levels(k_vals$pool.n) <- c("no.n", "n")

fit_k.wood.p.pooled <- brm(k.sil.wood ~ pool.p + pool.n + (1 | idplot),
    data = k_vals, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/k_wood_pooled_model",
    file_refit = "on_change")
Code
extended_summary(gsub.pattern = "b_treatment|b_", gsub.replacement = "",
    highlight = TRUE, remove.intercepts = TRUE, read.file = "./data/processed/k_wood_pooled_model.rds")

3.8 k_wood_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.wood ~ pool.p + pool.n + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 7607.822 5268.122 2033643880
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.pp -0.205 -0.414 0.010 1.001 7607.822 5268.122
pool.nn 0.015 -0.190 0.226 1 8470.129 5681.055

## Phosphorus vs no-phosphorus

Code
agg_kvals <- aggregate(k.sil.wood ~ p.treat, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.wood ~ p.treat, k_vals, se)$k.sil.wood
agg_kvals$sd <- aggregate(k.sil.wood ~ p.treat, k_vals, sd)$k.sil.wood


agg_kvals$p.treat <- factor(agg_kvals$p.treat, labels = c("No P", "P"))
agg_kvals$n <- aggregate(k.sil.wood ~ p.treat, k_vals, length)$k.sil.wood
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 

# k_vals$p.treat <- ifelse(k_vals$p.treat == "no.p", "No P", "P")
# k_vals$p.treat <- factor(k_vals$p.treat)



# composed box plot
rn_p_wood <- ggplot(k_vals, aes(x = p.treat, y = k.sil.wood)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = p.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P"))

rn_p_wood

Code
ggsave("./output/phosphorus_decomposition_k.tiff", dpi = 300)

Download image

Code
fit_k.wood.p.no.p <- brm(k.sil.wood ~ p.treat + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = 40000, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_wood_p_no_p_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/k_wood_p_no_p_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

3.9 k_wood_p_no_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.wood ~ p.treat + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 84635.93 58396.48 542143825
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
p.treatP -0.205 -0.412 -0.003 1 84635.93 58396.48

3.10 Nitrogen vs no-nitrogen

Code
agg_kvals <- aggregate(k.sil.wood ~ n.treat, k_vals, mean)
agg_kvals$se <- aggregate(k.sil.wood ~ n.treat, k_vals, se)$k.sil.wood
agg_kvals$sd <- aggregate(k.sil.wood ~ n.treat, k_vals, sd)$k.sil.wood
agg_kvals$n.treat <- factor(agg_kvals$n.treat, labels = c("No N", "N"))
agg_kvals$n <- aggregate(k.sil.wood ~ n.treat, k_vals, length)$k.sil.wood
agg_kvals$n.labels <- paste("n =", agg_kvals$n) 
k_vals$n.treat <- factor(k_vals$n.treat, labels = c("No N", "N"))

# composed box plot
rn_n_wood <- ggplot(k_vals, aes(x = n.treat, y = k.sil.wood)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = n.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P"))

rn_n_wood

Code
ggsave("./output/nitrogen_decomposition_k.tiff", dpi = 300)

Download image

Code
fit_k.wood.n.no.n <- brm(k.sil.wood ~ n.treat + (1 | idplot), data = k_vals,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/k_wood_n_no_n_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/k_wood_n_no_n_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

3.11 k_wood_n_no_n_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 k.sil.wood ~ n.treat + (1 | idplot) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 6926.307 5232.937 1558858893
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
n.treatN -0.014 -0.234 0.213 1 6926.307 5232.937

4 Nutrient content by remaining litter mass

4.1 Nitrogen

Code
nutr$prom.hoja.reman.sc <- scale(nutr$prom.hoja.reman)

ggplot(data = nutr, aes(x = prom.hoja.reman, y = perc.n, color = treat)) +
    geom_point() + labs(x = "Remaining litter mass (% initial)", y = "Litter N concentration (%)",
    color = "Treatment") + scale_color_viridis_d(alpha = 0.5) + geom_smooth(method = "lm",
    se = FALSE) + scale_x_reverse()

Code
ggsave("./output/nitrogen_by_litter_mass.tiff", dpi = 300)

Download image

Code
nutr$prop.n <- nutr$perc.n/100
fit_pern_by_rem_leave <- brm(prop.n ~ prom.hoja.reman.sc * treat +
    (1 | plot), data = nutr, chains = chains, family = Beta(link = "logit"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/n_per_by_leave_rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/n_per_by_leave_rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

4.2 n_per_by_leave_rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.n ~ prom.hoja.reman.sc * treat + (1 | plot) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3460.014 4780.304 1946978068
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
prom.hoja.reman.sc -0.098 -0.189 -0.009 1 3460.014 4780.304
treatN -0.092 -0.232 0.043 1 5550.278 5747.337
treatNP -0.036 -0.169 0.101 1 5303.031 6022.865
treatP -0.017 -0.150 0.119 1 5333.495 6084.582
prom.hoja.reman.sc:treatN 0.034 -0.088 0.156 1 4089.461 5486.316
prom.hoja.reman.sc:treatNP -0.046 -0.187 0.091 1 4616.456 4875.071
prom.hoja.reman.sc:treatP -0.008 -0.140 0.121 1 4774.373 5606.663

Code
fit_pern_by_rem_leave <- brm(prop.n ~ prom.hoja.reman.sc * treat +
    (1 | plot), data = nutr, chains = chains, family = Beta(link = "logit"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/n_per_by_leave_rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/n_per_by_leave_rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

4.3 n_per_by_leave_rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.n ~ prom.hoja.reman.sc * treat + (1 | plot) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3460.014 4780.304 1946978068
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
prom.hoja.reman.sc -0.098 -0.189 -0.009 1 3460.014 4780.304
treatN -0.092 -0.232 0.043 1 5550.278 5747.337
treatNP -0.036 -0.169 0.101 1 5303.031 6022.865
treatP -0.017 -0.150 0.119 1 5333.495 6084.582
prom.hoja.reman.sc:treatN 0.034 -0.088 0.156 1 4089.461 5486.316
prom.hoja.reman.sc:treatNP -0.046 -0.187 0.091 1 4616.456 4875.071
prom.hoja.reman.sc:treatP -0.008 -0.140 0.121 1 4774.373 5606.663

4.4 Phosphorus

Code
ggplot(data = sub.nutr, aes(x = prom.hoja.reman, y = perc.p, color = treat)) +
    geom_point() + labs(x = "Remaining litter mass (% initial)", y = "Litter P concentration (%)",
    color = "Treatment") + scale_color_viridis_d(alpha = 0.5) + geom_smooth(method = "lm",
    se = FALSE) + scale_x_reverse()

Code
ggsave("./output/phosphorus_by_litter_mass.tiff", dpi = 300)

Download image

Code
sub.nutr$prom.hoja.reman.sc <- scale(sub.nutr$prom.hoja.reman)

sub.nutr$prop.p <- sub.nutr$perc.p/100

fit_perp_by_rem_leave <- brm(prop.p ~ prom.hoja.reman.sc * treat +
    (1 | plot), data = sub.nutr, chains = chains, family = Beta(link = "logit"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/p_per_by_leave_rem_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/p_per_by_leave_rem_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

4.5 p_per_by_leave_rem_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 prop.p ~ prom.hoja.reman.sc * treat + (1 | plot) beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) sd-student_t(3, 0, 20) 4000 4 1 2000 0 (0%) 0 3851.596 5069.62 800295202
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
prom.hoja.reman.sc 0.029 -0.299 0.341 1.001 3851.596 5069.620
treatN -0.102 -0.604 0.376 1.001 6814.069 5982.112
treatNP 0.029 -0.443 0.494 1.001 6539.123 6241.615
treatP 0.071 -0.433 0.556 1.001 6735.901 5998.187
prom.hoja.reman.sc:treatN 0.019 -0.430 0.467 1.001 4496.387 5452.440
prom.hoja.reman.sc:treatNP -0.046 -0.532 0.413 1.001 5013.437 5635.971
prom.hoja.reman.sc:treatP -0.031 -0.499 0.429 1 5069.411 5782.291

Takeaways

  • Nitrogen percentage, but no Phosphorus percentage, increases along with remaining litter mass

 

5 Nutrient ratios

5.1 C:N

Code
# excluding plot 9
agg_cn <- aggregate(cn.mol.kg ~ colecta + treat + days, nutr, mean)

agg_cn$sd <- aggregate(cn.mol.kg ~ colecta + treat + days, nutr, sd)$cn.mol.kg

agg_cn$se <- aggregate(cn.mol.kg ~ colecta + treat + days, nutr, se)$cn.mol.kg


agg_cn$treat <- factor(agg_cn$treat, levels = c("C", "N", "P", "NP"))

pd <- position_dodge(15)

ggplot(agg_cn, aes(x = days, y = cn.mol.kg, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = cn.mol.kg + se, ymin = cn.mol.kg -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5) + labs(x = "Time (days)", y = "Litter C:N ratio",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_cn$days),
    labels = unique(agg_cn$days)) + theme(legend.position = c(0.9,
    0.8))

Code
ggsave("./output/cn_ratio_through_time.tiff", dpi = 300)

Download image

Code
fit.cn <- brm(cn.mol.kg ~ treat * days.sc + (1 | plot.f), data = nutr,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/cn_model", file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/cn_model.rds", gsub.pattern = "b_treatment|b_",
    gsub.replacement = "", highlight = TRUE, remove.intercepts = TRUE)

5.2 cn_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cn.mol.kg ~ treat * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 35587.38 44645.52 1143833718
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN 0.009 -0.099 0.111 1 45969.23 44645.52
treatNP -0.007 -0.110 0.097 1 46816.05 48244.92
treatP -0.009 -0.113 0.094 1 47348.16 50561.75
days.sc -0.180 -0.244 -0.118 1 35587.38 47992.48
treatN:days.sc 0.039 -0.046 0.124 1 45580.65 56260.34
treatNP:days.sc 0.014 -0.072 0.101 1 45607.95 54630.70
treatP:days.sc -0.001 -0.087 0.085 1 45397.25 54204.90

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")

sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")

fit.cn <- brm(cn.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 |
    plot.f), data = sub.nutr, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/cn_pooled_model2",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/cn_pooled_model2.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

5.3 cn_pooled_model2

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cn.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4972.048 5458.455 1861560814
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.016 -0.089 0.059 1.001 6374.144 5458.455
days.sc -0.142 -0.193 -0.091 1 4972.048 6028.842
pool.pp -0.022 -0.092 0.053 1.001 6707.516 5648.389
pool.nn:days.sc -0.038 -0.101 0.024 1.001 7149.741 5635.482
days.sc:pool.pp -0.024 -0.085 0.037 1 7049.829 6084.487

5.4 N:P

Code
# excluding plot 9
agg_np <- aggregate(np.mol.kg ~ colecta + treat + days, sub.nutr,
    mean)

agg_np$sd <- aggregate(np.mol.kg ~ colecta + treat + days, sub.nutr,
    sd)$np.mol.kg

agg_np$se <- aggregate(np.mol.kg ~ colecta + treat + days, sub.nutr,
    se)$np.mol.kg


agg_np$treat <- factor(agg_np$treat, levels = c("C", "N", "P", "NP"))


pd <- position_dodge(15)

ggplot(agg_np, aes(x = days, y = np.mol.kg, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = np.mol.kg + se, ymin = np.mol.kg -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5) + labs(x = "Time (days)", y = "Litter N:P ratio",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_np$days),
    labels = unique(agg_np$days)) + theme(legend.position = c(0.2,
    0.8))

Code
ggsave("./output/np_ratio_through_time.tiff", dpi = 300)

Download image

Code
fit.np <- brm(np.mol.kg ~ treat * days.sc + (1 | plot.f), data = sub.nutr,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/np_model", file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/np_model.rds", gsub.pattern = "b_treatment|b_",
    gsub.replacement = "", highlight = TRUE, remove.intercepts = TRUE)

5.5 np_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 np.mol.kg ~ treat * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 3190.685 3633.497 1289571581
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN 0.056 -0.123 0.239 1 4245.766 4457.117
treatNP -0.092 -0.269 0.089 1 4416.783 4560.838
treatP -0.135 -0.324 0.063 1.001 4267.649 3854.531
days.sc 0.176 0.064 0.292 1 3190.685 3633.497
treatN:days.sc -0.064 -0.225 0.098 1 3920.658 4291.891
treatNP:days.sc -0.069 -0.225 0.085 1 4045.302 4896.536
treatP:days.sc -0.044 -0.209 0.123 1 4014.292 4334.086

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")


sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")

fit.cn <- brm(np.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 |
    plot.f), data = sub.nutr, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/np_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/np_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

5.6 np_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 np.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5387.213 5113.188 2141137591
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.049 -0.179 0.083 1 6590.651 5113.188
days.sc 0.122 0.029 0.216 1.001 5387.213 5886.174
pool.pp -0.143 -0.267 -0.017 1.001 6770.399 5282.082
pool.nn:days.sc 0.046 -0.065 0.155 1 6964.034 6017.103
days.sc:pool.pp -0.025 -0.132 0.083 1.001 6438.723 5548.293

5.7 C:P

Code
# excluding plot 9
agg_cp <- aggregate(cp.mol.kg ~ colecta + treat + days, sub.nutr,
    mean)

agg_cp$sd <- aggregate(cp.mol.kg ~ colecta + treat + days, sub.nutr,
    sd)$cp.mol.kg

agg_cp$se <- aggregate(cp.mol.kg ~ colecta + treat + days, sub.nutr,
    se)$cp.mol.kg

agg_cp$treat <- factor(agg_cp$treat, levels = c("C", "N", "P", "NP"))


pd <- position_dodge(15)

ggplot(agg_cp, aes(x = days, y = cp.mol.kg, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = cp.mol.kg + se, ymin = cp.mol.kg -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5) + labs(x = "Time (days)", y = "Litter C:P ratio",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_cp$days),
    labels = unique(agg_cp$days)) + theme(legend.position = c(0.9,
    0.8))

Code
ggsave("./output/cp_ratio_through_time.tiff", dpi = 300)

Download image

Code
fit.cp <- brm(cp.mol.kg ~ treat * days.sc + (1 | plot.f), data = sub.nutr,
    chains = chains, family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/cp_model", file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/cp_model.rds", gsub.pattern = "b_treatment|b_",
    gsub.replacement = "", highlight = TRUE, remove.intercepts = TRUE)

5.8 cp_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cp.mol.kg ~ treat * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 3577.33 4126.234 1451904224
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN 0.080 -0.110 0.263 1.001 4087.074 4654.916
treatNP -0.115 -0.303 0.074 1.001 3850.361 4126.234
treatP -0.164 -0.373 0.031 1.001 4049.911 4390.919
days.sc 0.003 -0.100 0.107 1.001 3577.330 4604.079
treatN:days.sc -0.014 -0.163 0.131 1.001 4559.490 5519.771
treatNP:days.sc -0.082 -0.224 0.061 1.001 4352.980 5424.810
treatP:days.sc -0.065 -0.219 0.086 1.001 4635.557 5587.110

Code
sub.nutr$pool.p <- ifelse(sub.nutr$treat %in% c("P", "NP"), "p", "no.p")
sub.nutr$pool.n <- ifelse(sub.nutr$treat %in% c("N", "NP"), "n", "no.n")


sub.nutr$pool.n <- factor(sub.nutr$pool.n)

levels(sub.nutr$pool.n) <- c("no.n", "n")

fit.cn <- brm(cp.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 |
    plot.f), data = sub.nutr, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/cp_pooled_model",
    file_refit = "on_change")
Code
extended_summary(read.file = "./data/processed/cp_pooled_model.rds",
    gsub.pattern = "b_treatment|b_", gsub.replacement = "", highlight = TRUE,
    remove.intercepts = TRUE)

5.9 cp_pooled_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cp.mol.kg ~ pool.n * days.sc + pool.p * days.sc + (1 | plot.f) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4952.373 4330.513 856243609
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.066 -0.197 0.064 1.001 4952.373 4799.791
days.sc -0.011 -0.099 0.076 1.001 5220.520 5293.257
pool.pp -0.180 -0.313 -0.048 1.001 4994.343 4330.513
pool.nn:days.sc 0.015 -0.089 0.119 1 6571.496 5341.141
days.sc:pool.pp -0.067 -0.170 0.034 1.001 5521.999 4826.865


6 Combined plots

6.1 Remaining mass

Code
agg_rem_w$substrate <- "Wood"
agg_rem$substrate <- "Litter"

names(agg_rem) <- names(agg_rem_w) <- c("colecta", "trat", "days",
    "perc.rem", "sd", "se", "substrate")

agg_rem_pooled <- rbind(agg_rem, agg_rem_w)

ggplot(agg_rem_pooled, aes(x = days, y = perc.rem, color = trat)) +
    geom_point(size = 2, position = pd) + geom_errorbar(aes(ymax = perc.rem +
    se, ymin = perc.rem - se), width = 0, position = pd) + geom_line(size = 1.2,
    position = pd) + scale_color_viridis_d(alpha = 0.5, labels = c("Control",
    "+N", "+P", "+NP")) + labs(x = "Time (days)", y = "Remaining mass (%)",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_rem_pooled$days),
    labels = unique(agg_rem_pooled$days)) + facet_wrap(~substrate,
    nrow = 2)

Code
ggsave("./output/remaining_mass_combined.tiff", dpi = 300)

Download image

6.2 Litter content

Code
agg_p$nutrient <- "P"
agg_n$nutrient <- "N"

names(agg_n) <- names(agg_p) <- c("colecta", "treat", "days", "perc",
    "sd", "se", "nutrient")

agg_np2 <- rbind(agg_n, agg_p)

ggplot(agg_np2, aes(x = days, y = perc, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = perc + se, ymin = perc -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5, labels = c("Control", "+N",
        "+P", "+NP")) + labs(x = "Time (days)", y = "Litter nutrient content (% initial)",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_p$days),
    labels = unique(agg_p$days)) + facet_wrap(~nutrient, nrow = 2)

Code
ggsave("./output/litter_content_combined.tiff", dpi = 300)

Download image

6.3 Concentration

Code
agg_conc_p$nutrient <- "P"
agg_conc_n$nutrient <- "N"

names(agg_conc_n) <- names(agg_conc_p) <- c("colecta", "treat", "days",
    "perc", "sd", "se", "nutrient")

agg_conc_np <- rbind(agg_conc_n, agg_conc_p)

ggplot(agg_conc_np, aes(x = days, y = perc, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = perc + se, ymin = perc -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5, labels = c("Control", "+N",
        "+P", "+NP")) + labs(x = "Time (days)", y = "Litter nutrient concentration (%)",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_conc_p$days),
    labels = unique(agg_conc_p$days)) + facet_wrap(~nutrient, nrow = 2,
    scales = "free_y")

Code
ggsave("./output/concentration_combined.tiff", dpi = 300)

Download image

6.4 Nutrient ratios

Code
agg_cn$nutrients <- "C:N"
agg_cp$nutrients <- "C:P"
agg_np$nutrients <- "N:P"

names(agg_cn) <- names(agg_cp) <- names(agg_np) <- c("colecta", "treat",
    "days", "mol.kg", "sd", "se", "nutrients")

agg_ratios <- rbind(agg_cn[, names(agg_cn)], agg_cp[, names(agg_cn)],
    agg_np[, names(agg_cn)])

ggplot(agg_ratios, aes(x = days, y = mol.kg, color = treat)) + geom_point(size = 2,
    position = pd) + geom_errorbar(aes(ymax = mol.kg + se, ymin = mol.kg -
    se), width = 0, position = pd) + geom_line(size = 1.2, position = pd) +
    scale_color_viridis_d(alpha = 0.5, labels = c("Control", "+N",
        "+P", "+NP")) + labs(x = "Time (days)", y = "Litter nutrient ratios",
    color = "Treatment") + scale_x_continuous(breaks = unique(agg_ratios$days),
    labels = unique(agg_ratios$days)) + facet_wrap(~nutrients, nrow = 3,
    scales = "free_y")

Code
ggsave("./output/nutrient_ratios_combined.tiff", dpi = 300, width = 10,
    height = 12)

Download image

6.5 Decomposition constant

Code
rn_n_wood_dat <- rn_n_wood$data[, c("n.treat", "k.sil.wood")]
rn_n_litter_dat <- rn_n_litter$data[, c("n.treat", "k.sil.litt")]
rn_p_wood_dat <- rn_p_wood$data[, c("p.treat", "k.sil.wood")]
rn_p_litter_dat <- rn_p_litter$data[, c("p.treat", "k.sil.litt")]

names(rn_p_wood_dat) <- names(rn_n_wood_dat)  <- names(rn_p_litter_dat) <- names(rn_n_litter_dat) <- c("treatment", "k")
rn_p_wood_dat$substrate <- rn_n_wood_dat$substrate <- "wood"
rn_p_litter_dat$substrate <- rn_n_litter_dat$substrate <- "litter"

rn_n_wood_dat$nutrient <- rn_n_litter_dat$nutrient <- "N"
rn_p_litter_dat$nutrient <- rn_p_wood_dat$nutrient <- "P"

rn_k_dat <- rbind(rn_n_wood_dat, rn_p_wood_dat, rn_n_litter_dat, rn_p_litter_dat)                             
                             
# composed box plot
ggplot(rn_k_dat, aes(x = treatment, y = k)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  # geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = n.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P")) +
    facet_grid(~ substrate)

Code
ggsave("./output/decomposition_k_combined_v1.tiff", dpi = 300, width = 10, height = 12)

Download image

Code
# composed box plot
ggplot(rn_k_dat, aes(x = treatment, y = k)) +
## add half-violin from {ggdist} package
  ggdist::stat_halfeye(
    fill = fill_color,
    alpha = 0.5,
    ## custom bandwidth
    adjust = .5,
    ## adjust height
    width = .6,
    .width = 0,
    ## move geom to the cright
    justification = -.2,
    point_colour = NA
  ) +
  geom_boxplot(fill = fill_color,
    width = .15,
    ## remove outliers
    outlier.shape = NA ## `outlier.shape = NA` works as well
  ) +
  ## add justified jitter from the {gghalves} package
  geom_half_point(
    color = fill_color,
    ## draw jitter on the left
    side = "l",
    ## control range of jitter
    range_scale = .4,
    ## add some transparency
    alpha = .5,
    transformation = ggplot2::position_jitter(height = 0)

  ) +
  labs(y = "Decomposition constant (k)", x = "P treatment") +
  # geom_text(data = agg_kvals, aes(y = rep(-0.387, nrow(agg_kvals)), x = n.treat, label = n.labels), nudge_x = 0, size = 6) +
     theme_classic(base_size = 18) +
theme(axis.text.x = element_text(angle = 30, hjust = 1))  +
    scale_x_discrete(labels=c("No P" = "No P", "P" = "+P")) +
    facet_grid(substrate ~ nutrient, scales = "free_x")

Code
ggsave("./output/decomposition_k_combined_v12.tiff", dpi = 300, width = 10, height = 12)

Download image

7 Carbon inputs/outputs

7.1 Litter

7.1.1 N

Code
# read data
c_input_litter <- read.csv("./data/raw/annual_litter_C_input.csv")

# same with ggplot2
ggplot(c_input_litter, aes(x = n.pooled, y = cr.total)) + geom_boxplot() +
    labs(y = "Carbon input (Mg C ha-1 yr-1)", x = "N treatment") +
    theme_classic(base_size = 18) + scale_x_discrete(labels = c(no.n = "-N",
    with.n = "+N"))

Code
# mod1 <- lm(cr.total ~ n.pooled, data =
# c_input_litter[complete.cases(c_input_litter), ])

prior <- c(prior(normal(0, 10), "b"), prior(normal(0, 50), "Intercept"))


litter_input_n <- brm(cr.total ~ n.pooled, data = c_input_litter[complete.cases(c_input_litter),
    c("cr.total", "n.pooled")], chains = chains, family = gaussian(),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/litter_input_n_model",
    file_refit = "on_change")
Code
extended_summary(fit = litter_input_n, highlight = TRUE, remove.intercepts = TRUE)

7.2 litter_input_n

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cr.total ~ n.pooled gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 4707.389 4077.719 1841398531
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_n.pooledwith.n -0.143 -0.537 0.268 1.001 4707.389 4077.719

7.2.1 P

Code
ggplot(c_input_litter, aes(x = p.pooled, y = cr.total)) + geom_boxplot() +
    labs(y = "Carbon input (Mg C ha-1 yr-1)", x = "P treatment") +
    theme_classic(base_size = 18) + scale_x_discrete(labels = c(no.p = "-P",
    with.p = "+P"))

Code
litter_input_p <- brm(cr.total ~ p.pooled, data = c_input_litter[complete.cases(c_input_litter),
    c("cr.total", "p.pooled")], chains = chains, family = gaussian(),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/litter_input_p_model",
    file_refit = "on_change")
Code
extended_summary(fit = litter_input_p, highlight = TRUE, remove.intercepts = TRUE)

7.3 litter_input_p

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 cr.total ~ p.pooled gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 4988.772 4391.955 1588616040
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_p.pooledwith.p 0.348 -0.019 0.704 1 4988.772 4391.955

7.4 CO2 output

7.4.1 N

Code
c_avg_co2 <- read.csv("./data/raw/co2_plot_averages.csv")

ggplot(c_avg_co2, aes(x = pool.n, y = annual.flux)) + geom_boxplot() +
    labs(y = "Carbon output (Mg C ha-1 yr-1)", x = "N treatment") +
    theme_classic(base_size = 18)

Code
prior <- c(prior(normal(0, 10), "b"), prior(normal(0, 50), "Intercept"))

co2_output_n <- brm(annual.flux ~ pool.n, data = c_avg_co2[complete.cases(c_avg_co2),
    ], chains = chains, family = gaussian(), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/co2_output_n_model", file_refit = "on_change")
Code
extended_summary(fit = co2_output_n, highlight = TRUE, remove.intercepts = TRUE)

7.5 co2_output_n

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 annual.flux ~ pool.n gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 50024.09 42637.79 306100029
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.nPN 1.081 -1.215 3.366 1 50024.09 42637.79

7.5.1 P

Code
ggplot(c_avg_co2, aes(x = pool.p, y = annual.flux)) + geom_boxplot() +
    labs(y = "Carbon output (Mg C ha-1 yr-1)", x = "P treatment") +
    theme_classic(base_size = 18)

Code
co2_output_p <- brm(annual.flux ~ pool.p, data = c_avg_co2[complete.cases(c_avg_co2),
    ], chains = chains, family = gaussian(), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/co2_output_p_model", file_refit = "on_change")
Code
extended_summary(fit = co2_output_p, highlight = TRUE, remove.intercepts = TRUE)

7.6 co2_output_p

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 annual.flux ~ pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 51625.97 44811.71 1833764711
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.pPP 0.57 -1.764 2.906 1 51625.97 44811.71

8 Microbial biomass

8.1 N

Code
soil_mic <- read.csv("./data/raw/strimastersoils.csv")

# remove plot 19
soil_mic <- soil_mic[soil_mic$idplot != 19, ]

# names(soil_mic)


soil_mic$BS <- soil_mic$BS/100
soil_mic$Al.sat <- soil_mic$Al.sat/100

variables <- c("mic.c", "mic.n", "mic.p", "mic.cn", "mic.cp", "mic.np",
    "AG", "BG", "XYL", "CEL", "NAG", "LAP", "MUP", "BIS", "S", "BG.NAG",
    "BG.MUP", "NAG.MUP", "BG.S", "NAG.S", "MUP.S", "ph.h2o", "ph.cacl2",
    "tc.g.kg.18", "tn.g.kg.18", "tp.g.kg.18", "CN", "CP", "NP", "k2so4.C",
    "nitrate.2017", "resin.p", "ox.Al", "ox.Fe", "Al", "Ca", "Fe",
    "K", "Mg", "Mn", "Na", "TEB", "ECEC", "BS", "Al.sat")


variables[!variables %in% names(soil_mic)]
character(0)
Code
for (i in variables) {
    soil_mic$var <- soil_mic[, i]
    gg <- ggplot(soil_mic, aes(x = treat.pool.n, y = var)) + geom_boxplot() +
        geom_jitter() + labs(y = i, x = "N treatment") + theme_classic(base_size = 18)

    print(gg)
}

Code
soil_mic$var <- NULL

prior <- c(prior(normal(0, 10), "b"), prior(normal(0, 50), "Intercept"))

for (i in variables) {
    soil_mic$var <- soil_mic[, i]

    if (i %in% c("ph.cacl2", "ph.h2o"))
        fam <- gaussian() else fam <- Gamma(link = "log")

    if (i %in% c("BS", "Al.sat"))
        fam <- Beta(link = "logit") else if (any(soil_mic$var < 0))
        soil_mic$var <- soil_mic$var + min(abs(soil_mic$var)) + 1e-04

    co2_output_n <- brm(var ~ treat.pool.n, data = soil_mic, chains = chains,
        family = fam, iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
            max_treedepth = 15), cores = chains, prior = prior, file = paste("./data/processed/soil_",
            i, "_model", sep = ""), file_refit = "on_change")
}
Code
for (i in variables) {
    mod <- paste("./data/processed/soil_", i, "_model.rds", sep = "")

    # print(paste('###', i))

    # print('<br>')

    extended_summary(read.file = mod, highlight = TRUE, remove.intercepts = TRUE)
}

8.2 soil_mic.c_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4868.261 4321.646 388882366
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.01 -0.142 0.16 1.001 4868.261 4321.646

8.3 soil_mic.n_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5122.994 4234.255 2079036467
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.004 -0.156 0.161 1.001 5122.994 4234.255

8.4 soil_mic.p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5318.858 4547.305 837207006
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.147 -0.756 0.453 1 5318.858 4547.305

8.5 soil_mic.cn_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5516.347 4584.837 1551721986
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.003 -0.065 0.072 1.001 5516.347 4584.837

8.6 soil_mic.cp_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5468.085 3663.914 1436223325
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.091 -0.661 0.486 1.002 5468.085 3663.914

8.7 soil_mic.np_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5380.58 4535.378 410842257
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.124 -0.718 0.464 1 5380.58 4535.378

8.8 soil_AG_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5193.643 4619.1 1489137066
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.7 -0.215 1.612 1.001 5193.643 4619.1

8.9 soil_BG_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4895.125 3909.069 2119940681
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.005 -0.331 0.337 1 4895.125 3909.069

8.10 soil_XYL_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4958.338 4508.23 276700744
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.214 -0.438 0.005 1.001 4958.338 4508.23

8.11 soil_CEL_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5132.769 4188.754 1622464857
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.301 -0.572 -0.028 1 5132.769 4188.754

8.12 soil_NAG_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5146.718 3859.533 1415878801
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.014 -0.459 0.426 1.002 5146.718 3859.533

8.13 soil_LAP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4924.06 3662.59 1285672946
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.064 -0.132 0.27 1.002 4924.06 3662.59

8.14 soil_MUP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5391.992 4435.481 224722873
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.019 -0.213 0.171 1.001 5391.992 4435.481

8.15 soil_BIS_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5316.739 4001.738 1066066973
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.05 -0.137 0.235 1.001 5316.739 4001.738

8.16 soil_S_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5251.996 3908.308 426190710
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.465 0.195 0.733 1.001 5251.996 3908.308

8.17 soil_BG.NAG_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5297.136 4643.727 698772401
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.001 -0.339 0.343 1 5297.136 4643.727

8.18 soil_BG.MUP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5359.387 4436.924 1010778721
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.006 -0.267 0.281 1.001 5359.387 4436.924

8.19 soil_NAG.MUP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4844.928 4484.192 1586151309
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.004 -0.315 0.325 1 4844.928 4484.192

8.20 soil_BG.S_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5714.661 4120.333 299830015
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.532 -0.818 -0.246 1 5714.661 4120.333

8.21 soil_NAG.S_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4330.65 4092.301 1301119202
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.535 -0.877 -0.188 1.001 4330.65 4092.301

8.22 soil_MUP.S_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5168.698 3743.688 43130882
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.499 -0.674 -0.324 1.001 5168.698 3743.688

8.23 soil_ph.h2o_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 4919.781 4344.546 1848017699
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.073 -0.033 0.179 1.001 4919.781 4344.546

8.24 soil_ph.cacl2_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 5277.173 4707.812 2036628202
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.079 0.02 0.137 1 5277.173 4707.812

8.25 soil_tc.g.kg.18_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5302.551 4289.977 408112050
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.061 -0.163 0.04 1.001 5302.551 4289.977

8.26 soil_tn.g.kg.18_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5503.983 4579.97 891725003
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.045 -0.148 0.059 1.001 5503.983 4579.97

8.27 soil_tp.g.kg.18_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4683.837 3961.063 1593115603
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.016 -0.233 0.266 1.002 4683.837 3961.063

8.28 soil_CN_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4854.691 4260.409 2074589522
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.015 -0.065 0.034 1.001 4854.691 4260.409

8.29 soil_CP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5738.094 4379.704 609487041
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.069 -0.34 0.208 1.001 5738.094 4379.704

8.30 soil_NP_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5555.132 4473.511 1778337075
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.055 -0.332 0.219 1 5555.132 4473.511

8.31 soil_k2so4.C_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5499.452 4114.117 352392908
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.05 -0.146 0.045 1 5499.452 4114.117

8.32 soil_nitrate.2017_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5225.957 3962.206 320515022
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.188 -0.492 0.121 1.001 5225.957 3962.206

8.33 soil_resin.p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4562.667 3710.685 305619031
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.044 -1.225 1.11 1 4562.667 3710.685

8.34 soil_ox.Al_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5176.191 4582.139 1544465228
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.008 -0.092 0.109 1.001 5176.191 4582.139

8.35 soil_ox.Fe_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4491.515 4228.122 1893167504
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.004 -0.188 0.19 1 4491.515 4228.122

8.36 soil_Al_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4695.154 3445.353 7069508
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.094 -0.24 0.057 1 4695.154 3445.353

8.37 soil_Ca_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5285.348 4310.8 1363945139
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.134 -0.374 0.658 1.002 5285.348 4310.8

8.38 soil_Fe_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5205.852 4265.377 1941227008
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.232 -0.658 0.19 1 5205.852 4265.377

8.39 soil_K_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4549.01 4085.611 1717272043
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.005 -0.193 0.196 1 4549.01 4085.611

8.40 soil_Mg_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4178.52 4213.992 516505242
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.225 -0.061 0.511 1.001 4178.52 4213.992

8.41 soil_Mn_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5360.722 4335.649 728244406
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.294 -0.715 0.114 1.001 5360.722 4335.649

8.42 soil_Na_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4874.044 4084.951 1223601315
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.05 -0.804 0.907 1.001 4874.044 4084.951

8.43 soil_TEB_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5461.233 4093.972 172609891
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.132 -0.233 0.488 1.001 5461.233 4093.972

8.44 soil_ECEC_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5430.892 4676.379 450126297
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.026 -0.169 0.118 1.001 5430.892 4676.379

8.45 soil_BS_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5331.718 4265.156 1197941314
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.23 -0.158 0.611 1.001 5331.718 4265.156

8.46 soil_Al.sat_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.n beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5067.339 4337.456 2038804154
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.198 -0.578 0.18 1.001 5067.339 4337.456

8.47 P

Code
for (i in variables) {
    soil_mic$var <- soil_mic[, i]
    gg <- ggplot(soil_mic, aes(x = treat.pool.p, y = var)) + geom_boxplot() +
        geom_jitter() + labs(y = i, x = "N treatment") + theme_classic(base_size = 18)

    print(gg)
}

Code
soil_mic$var <- NULL

prior <- c(prior(normal(0, 10), "b"), prior(normal(0, 50), "Intercept"))

for (i in variables) {
    soil_mic$var <- soil_mic[, i]

    if (i %in% c("ph.cacl2", "ph.h2o"))
        fam <- gaussian() else fam <- Gamma(link = "log")

    if (i %in% c("BS", "Al.sat"))
        fam <- Beta(link = "logit") else if (any(soil_mic$var < 0))
        soil_mic$var <- soil_mic$var + min(abs(soil_mic$var)) + 1e-04

    co2_output_n <- brm(var ~ treat.pool.p, data = soil_mic, chains = chains,
        family = fam, iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
            max_treedepth = 15), cores = chains, prior = prior, file = paste("./data/processed/soil_",
            i, "_p_model", sep = ""), file_refit = "on_change")
}
Code
for (i in variables) {

    # print(paste('###', i)) print('<br>')

    mod <- paste("./data/processed/soil_", i, "_p_model.rds", sep = "")

    extended_summary(read.file = mod, highlight = TRUE, remove.intercepts = TRUE)
}

8.48 soil_mic.c_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5254.423 4087.203 1619772535
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.021 -0.137 0.176 1 5254.423 4087.203

8.49 soil_mic.n_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5380.757 4290.258 1724809407
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.045 -0.109 0.199 1.002 5380.757 4290.258

8.50 soil_mic.p_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4658.743 3898.682 18355867
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.686 0.14 1.217 1 4658.743 3898.682

8.51 soil_mic.cn_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4939.103 4047.057 1988390633
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.021 -0.09 0.048 1.001 4939.103 4047.057

8.52 soil_mic.cp_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5078.846 4320.969 830075251
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.249 -0.821 0.317 1 5078.846 4320.969

8.53 soil_mic.np_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5466.346 4671.333 1664581843
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.218 -0.804 0.363 1.001 5466.346 4671.333

8.54 soil_AG_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4046.104 3899.81 369610609
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.304 -0.723 1.294 1.002 4046.104 3899.81

8.55 soil_BG_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5252.244 3916.771 230487577
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.271 -0.573 0.037 1.002 5252.244 3916.771

8.56 soil_XYL_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5278.667 4385.356 346786086
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.053 -0.31 0.195 1.001 5278.667 4385.356

8.57 soil_CEL_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5038.825 4574.193 48303065
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.102 -0.198 0.405 1.001 5038.825 4574.193

8.58 soil_NAG_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5093.968 4037.547 1681758075
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.15 -0.593 0.293 1.001 5093.968 4037.547

8.59 soil_LAP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5314.079 4321.714 2018403912
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.022 -0.223 0.177 1.001 5314.079 4321.714

8.60 soil_MUP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4881.426 4464.812 2144303575
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.093 -0.283 0.1 1.001 4881.426 4464.812

8.61 soil_BIS_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4875.357 3842.318 1824909568
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.152 -0.331 0.029 1 4875.357 3842.318

8.62 soil_S_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5141.023 4185.62 256470436
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.053 -0.403 0.281 1.001 5141.023 4185.62

8.63 soil_BG.NAG_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4916.193 4053.668 1044332607
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.091 -0.441 0.253 1.001 4916.193 4053.668

8.64 soil_BG.MUP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5450.229 4657.839 1799322959
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.166 -0.429 0.102 1.001 5450.229 4657.839

8.65 soil_NAG.MUP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5016.339 4484.521 1325166174
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.05 -0.377 0.28 1.001 5016.339 4484.521

8.66 soil_BG.S_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5479.949 4675.524 1210930108
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.165 -0.536 0.209 1.001 5479.949 4675.524

8.67 soil_NAG.S_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5179.774 4169.31 1891409007
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.063 -0.494 0.348 1.002 5179.774 4169.31

8.68 soil_MUP.S_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5232.408 4224.996 1519392068
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.062 -0.351 0.222 1 5232.408 4224.996

8.69 soil_ph.h2o_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 5193.972 3854.91 1425442194
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.106 0.006 0.204 1 5193.972 3854.91

8.70 soil_ph.cacl2_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sigma-student_t(3, 0, 2.5) 4000 4 1 2000 0 (0%) 0 5449.317 4328.981 407771684
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.026 -0.042 0.094 1.002 5449.317 4328.981

8.71 soil_tc.g.kg.18_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4913.379 4360.371 1681907426
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.02 -0.086 0.126 1 4913.379 4360.371

8.72 soil_tn.g.kg.18_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5468.141 4656.546 1236264484
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.015 -0.095 0.121 1.001 5468.141 4656.546

8.73 soil_tp.g.kg.18_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5616.768 4229.056 375786421
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.267 0.048 0.477 1 5616.768 4229.056

8.74 soil_CN_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5557.565 4491.314 1804114578
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.001 -0.051 0.053 1.001 5557.565 4491.314

8.75 soil_CP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5164.896 4092.349 392127594
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.225 -0.489 0.025 1 5164.896 4092.349

8.76 soil_NP_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5380.989 4978.482 1048692193
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.224 -0.478 0.03 1.001 5380.989 4978.482

8.77 soil_k2so4.C_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5084.672 4174.936 1245119161
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0 -0.102 0.1 1 5084.672 4174.936

8.78 soil_nitrate.2017_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5647.381 4944.756 903397799
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.231 -0.534 0.071 1.001 5647.381 4944.756

8.79 soil_resin.p_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5129.235 4135.139 1452456828
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 2.58 1.907 3.239 1.001 5129.235 4135.139

8.80 soil_ox.Al_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5253.043 4566.782 461131068
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.081 -0.013 0.175 1.001 5253.043 4566.782

8.81 soil_ox.Fe_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5205.378 4064.252 43301179
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.12 -0.065 0.301 1 5205.378 4064.252

8.82 soil_Al_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5325.377 4314.366 31241315
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.083 -0.239 0.077 1 5325.377 4314.366

8.83 soil_Ca_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4950.633 4079.992 1957537385
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.737 0.314 1.156 1.001 4950.633 4079.992

8.84 soil_Fe_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5439.787 4440.793 287177801
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.162 -0.274 0.595 1.001 5439.787 4440.793

8.85 soil_K_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5099.784 4490.625 223624930
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.119 -0.065 0.302 1.001 5099.784 4490.625

8.86 soil_Mg_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4600.259 3900.516 281084920
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.048 -0.272 0.358 1.001 4600.259 3900.516

8.87 soil_Mn_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5125.287 4741.214 1937973339
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.035 -0.386 0.455 1 5125.287 4741.214

8.88 soil_Na_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5323.372 4415.292 723284088
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.174 -1.052 0.668 1.001 5323.372 4415.292

8.89 soil_TEB_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5287.152 4174.182 950962823
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.444 0.144 0.752 1.001 5287.152 4174.182

8.90 soil_ECEC_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5763.145 4344.108 467148483
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.082 -0.052 0.216 1 5763.145 4344.108

8.91 soil_BS_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4889.445 4014.359 1627503678
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.569 0.253 0.895 1.001 4889.445 4014.359

8.92 soil_Al.sat_p_model

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 var ~ treat.pool.p beta (logit) b-normal(0, 10) Intercept-normal(0, 50) phi-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 4718.71 4017.089 917329960
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.534 -0.843 -0.226 1.001 4718.71 4017.089

8.93 BIS by Nitrate rate

Code
soil_mic$Nrat <- soil_mic$nitrate.2017/soil_mic$resin.p

ggplot(soil_mic, aes(x = Nrat, y = BIS)) + geom_point() + geom_smooth(method = "lm") +
    theme_classic(base_size = 18)

Code
BIS_Nitrate_mod <- brm(BIS ~ Nrat, data = soil_mic, chains = chains,
    family = Gamma(link = "log"), iter = iters, backend = "cmdstanr",
    control = list(adapt_delta = 0.99, max_treedepth = 15), cores = chains,
    prior = prior, file = "./data/processed/soil_BIS_by_Nitrate_rate_model",
    file_refit = "on_change")

extended_summary(fit = BIS_Nitrate_mod, highlight = TRUE, remove.intercepts = TRUE)

8.94 BIS_Nitrate_mod

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 BIS ~ Nrat gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 4000 4 1 2000 0 (0%) 0 5643.561 4212.999 511552371
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_Nrat 0.016 -0.001 0.034 1.001 5643.561 4212.999

9 CO2 data

9.1 All sampling events

Code
co2mean <- read.csv("./data/raw/CO2_dat_mean.csv")

co2mean$date4 <- as.Date(co2mean$date4)
co2mean$day <- co2mean$date4 - min(co2mean$date4)

exp_flux_pool_mod <- brm(exp.flux ~ pool.n * day + (1 | id.plot/collar.generic),
    data = co2mean, chains = chains, family = student(), iter = iters,
    backend = "cmdstanr", control = list(adapt_delta = 0.99, max_treedepth = 15),
    cores = chains, prior = prior, file = "./data/processed/exp_flux_pool_n_model",
    file_refit = "on_change")

extended_summary(fit = exp_flux_pool_mod, highlight = TRUE, remove.intercepts = TRUE)

9.2 exp_flux_pool_mod

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 exp.flux ~ pool.n * day + (1 | id.plot/collar.generic) student (identity) b-normal(0, 10) Intercept-normal(0, 50) nu-gamma(2, 0.1) sd-student_t(3, 0, 2.5) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 33000.07 43714.7 1386974416
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.nnoN -0.839 -1.519 -0.165 1 33000.07 43714.70
b_day -0.009 -0.012 -0.006 1 87398.98 60692.18
b_pool.nnoN:day 0.006 0.002 0.009 1 90354.29 61147.64

Code
exp_flux_pool_p_mod <- brm(exp.flux ~ pool.p * day + (1 | id.plot/collar.generic),
    data = co2mean, chains = chains, family = student(), iter = iters,
    backend = "cmdstanr", control = list(adapt_delta = 0.99, max_treedepth = 15),
    cores = chains, prior = prior, file = "./data/processed/exp_flux_pool_p_model",
    file_refit = "on_change")

extended_summary(fit = exp_flux_pool_p_mod, highlight = TRUE, remove.intercepts = TRUE)

9.3 exp_flux_pool_p_mod

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 exp.flux ~ pool.p * day + (1 | id.plot/collar.generic) student (identity) b-normal(0, 10) Intercept-normal(0, 50) nu-gamma(2, 0.1) sd-student_t(3, 0, 2.5) sigma-student_t(3, 0, 2.5) 40000 4 1 20000 0 (0%) 0 36045.7 47450.92 1801513762
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.pP 0.176 -0.536 0.899 1 36045.70 47450.92
b_day -0.006 -0.008 -0.003 1 99278.34 61672.84
b_pool.pP:day 0.001 -0.002 0.005 1 94342.06 59599.81

9.4 Only first and last sampling events

Code
co2mean <- read.csv("./data/raw/CO2_dat_mean.csv")

co2mean$date4 <- as.Date(co2mean$date4)
co2mean$day <- co2mean$date4 - min(co2mean$date4)

sub_co2mean <- co2mean[co2mean$day %in% c(0, max(co2mean$day)), ]

sub_co2mean$day_f <- ifelse(sub_co2mean$day == 0, "first", "last")

exp_flux_pool_fl_mod <- brm(exp.flux ~ pool.n * day_f + (1 | id.plot/collar.generic),
    data = sub_co2mean, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/exp_flux_pool_n_first_last_model",
    file_refit = "on_change")

extended_summary(fit = exp_flux_pool_fl_mod, highlight = TRUE, remove.intercepts = TRUE)

9.5 exp_flux_pool_fl_mod

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 exp.flux ~ pool.n * day_f + (1 | id.plot/collar.generic) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 2.5) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 41481.73 52368.68 793319142
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.nnoN -0.083 -0.241 0.074 1 41481.73 52368.68
b_day_flast -0.184 -0.285 -0.084 1 66962.94 61807.41
b_pool.nnoN:day_flast 0.067 -0.069 0.201 1 64565.91 61471.79

Code
exp_flux_pool_p_fl_mod <- brm(exp.flux ~ pool.p * day_f + (1 | id.plot/collar.generic),
    data = sub_co2mean, chains = chains, family = Gamma(link = "log"),
    iter = iters, backend = "cmdstanr", control = list(adapt_delta = 0.99,
        max_treedepth = 15), cores = chains, prior = prior, file = "./data/processed/exp_flux_pool_p_first_last_model",
    file_refit = "on_change")

extended_summary(fit = exp_flux_pool_p_fl_mod, highlight = TRUE, remove.intercepts = TRUE)

9.6 exp_flux_pool_p_fl_mod

formula family priors iterations chains thinning warmup diverg_transitions rhats > 1.05 min_bulk_ESS min_tail_ESS seed
1 exp.flux ~ pool.p * day_f + (1 | id.plot/collar.generic) gamma (log) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 2.5) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 35314.55 47345.04 1209038702
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_pool.pP 0.017 -0.142 0.175 1 35314.55 47345.04
b_day_flast -0.154 -0.254 -0.054 1 57512.82 57924.25
b_pool.pP:day_flast 0.011 -0.125 0.147 1 54256.51 55731.36

10 Combined model diagnostics

Code
check_rds_fits(path = "./data/processed", html = TRUE)

 

Session information

R version 4.5.2 (2025-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=es_CR.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=es_CR.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=es_CR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_CR.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Costa_Rica
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] brmsish_1.0.0     ggdist_3.3.3      brms_2.23.0       Rcpp_1.1.2       
 [5] viridis_0.6.5     viridisLite_0.4.3 ggridges_0.5.7    posterior_1.6.1  
 [9] ggrepel_0.9.8     cowplot_1.2.0     tidybayes_3.0.7   ggplot2_4.0.3    
[13] readxl_1.4.5      knitr_1.52        kableExtra_1.4.0 

loaded via a namespace (and not attached):
 [1] pbapply_1.7-5         gridExtra_2.3.1       formatR_1.14         
 [4] remotes_2.5.0         inline_0.3.21         sandwich_3.1-1       
 [7] rlang_1.3.0           magrittr_2.0.5        multcomp_1.4-29      
[10] otel_0.2.0            matrixStats_1.5.0     compiler_4.5.2       
[13] mgcv_1.9-4            loo_2.9.0             systemfonts_1.3.1    
[16] vctrs_0.7.3           reshape2_1.4.5        stringr_1.6.0        
[19] pkgconfig_2.0.3       arrayhelpers_1.1-0    crayon_1.5.3         
[22] fastmap_1.2.0         backports_1.5.1       labeling_0.4.3       
[25] cmdstanr_0.9.0        rmarkdown_2.32        ps_1.9.3             
[28] ragg_1.5.0            purrr_1.2.2           xfun_0.61            
[31] jsonlite_2.0.0        parallel_4.5.2        R6_2.6.1             
[34] stringi_1.8.9         RColorBrewer_1.1-3    StanHeaders_2.32.10  
[37] cellranger_1.1.0      estimability_2.0.0    rstan_2.32.7         
[40] zoo_1.8-15            bayesplot_1.15.0      Matrix_1.7-4         
[43] splines_4.5.2         tidyselect_1.2.1      rstudioapi_0.18.0    
[46] abind_1.4-8           yaml_2.3.12           codetools_0.2-20     
[49] curl_8.0.0            processx_3.9.0        pkgbuild_1.4.8       
[52] lattice_0.22-9        tibble_3.3.1          plyr_1.8.9           
[55] withr_3.0.3           bridgesampling_1.2-1  S7_0.2.2             
[58] coda_0.19-4.1         evaluate_1.0.5        survival_3.8-6       
[61] sketchy_1.0.6         RcppParallel_5.1.11-2 xml2_1.6.0           
[64] pillar_1.11.1         tensorA_0.36.2.1      checkmate_2.3.4      
[67] stats4_4.5.2          distributional_0.6.0  generics_0.1.4       
[70] rstantools_2.6.0      scales_1.4.0          xtable_1.8-8         
[73] glue_1.8.1            emmeans_2.0.4         tools_4.5.2          
[76] data.table_1.18.2.1   mvtnorm_1.3-3         grid_4.5.2           
[79] tidyr_1.3.2           ape_5.8-1             QuickJSR_1.9.0       
[82] nlme_3.1-168          cli_3.6.6             textshaping_1.0.4    
[85] svUnit_1.0.8          svglite_2.2.2         Brobdingnag_1.2-9    
[88] dplyr_1.2.1           V8_8.2.0              gtable_0.3.6         
[91] digest_0.6.39         TH.data_1.1-5         htmlwidgets_1.6.4    
[94] farver_2.1.2          htmltools_0.5.9       lifecycle_1.0.5      
[97] MASS_7.3-65