Statistical analysis

Litter decomposition

Author

Marcelo Araya-Salas & Andrea Vincent

Published

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

All 4 chains finished successfully.
Mean chain execution time: 2.4 seconds.
Total execution time: 2.9 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 2990.553 4067.556 2104060876
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN -0.101 -0.606 0.395 1.001 4965.953 4744.576
treatNP 0.029 -0.462 0.517 1.001 4491.410 5232.077
treatP 0.073 -0.452 0.594 1 5091.589 4953.500
days.sc -0.045 -0.379 0.282 1.002 2990.553 4067.556
treatN:days.sc -0.006 -0.477 0.460 1.001 3671.670 5185.534
treatNP:days.sc 0.044 -0.417 0.493 1.002 3691.426 4849.748
treatP:days.sc 0.035 -0.440 0.511 1.001 3607.261 5039.955

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

All 4 chains finished successfully.
Mean chain execution time: 2.3 seconds.
Total execution time: 3.2 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 6157.892 5462.692 733949810
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.077 -0.267 0.422 1 10686.597 6251.665
days.sc -0.048 -0.333 0.228 1.001 6157.892 5462.692
pool.pp 0.105 -0.243 0.445 1.001 9449.246 5843.402
pool.nn:days.sc 0.003 -0.315 0.325 1 7751.982 5930.514
days.sc:pool.pp 0.041 -0.280 0.359 1 8676.741 6242.897

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 = iters, 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) 4000 4 1 2000 0 (0%) 0 7026.299 5655.843 1827091212
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
p.treatP -0.205 -0.42 0.002 1 7026.299 5655.843

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 = gaussian(),
    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) 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 3716.524 3690.366 2117990813
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn 0.019 -1.535 1.735 1.001 4144.515 3755.165
days.sc -2.922 -3.875 -1.959 1 6023.780 5903.474
pool.pp -0.089 -1.651 1.706 1 3716.524 3690.366
pool.nn:days.sc -0.688 -1.875 0.465 1.001 7797.942 6109.828
days.sc:pool.pp -0.232 -1.404 0.939 1.001 7108.256 5788.515

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 = gaussian(), 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) gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) sigma-student_t(3, 0, 5.3) 4000 4 1 2000 0 (0%) 0 3638.846 5080.571 1776170993
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN 1.339 -2.940 5.687 1 5158.413 5080.571
treatNP -2.279 -6.507 1.922 1.001 5246.206 5308.985
treatP -3.045 -7.703 1.707 1 5496.535 5219.925
days.sc 4.608 1.882 7.349 1.001 3638.846 5340.024
treatN:days.sc -1.856 -5.666 1.790 1.001 4428.210 5831.491
treatNP:days.sc -1.868 -5.626 1.866 1 4490.292 5729.434
treatP:days.sc -1.508 -5.547 2.500 1 5338.982 5836.349

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 = gaussian(),
    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) gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) sigma-student_t(3, 0, 5.3) 4000 4 1 2000 0 (0%) 0 5302.754 4784.708 320875556
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -1.020 -4.178 2.248 1.001 5794.370 4891.862
days.sc 3.059 0.715 5.351 1.001 5718.540 5556.031
pool.pp -3.389 -6.559 -0.158 1.001 5302.754 4784.708
pool.nn:days.sc 1.282 -1.471 4.074 1.001 7371.331 5652.011
days.sc:pool.pp -0.746 -3.397 1.943 1.001 6031.519 5815.715

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 = gaussian(), iter = iters, backend = "cmdstanr",
    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) gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) sigma-student_t(3, 0, 106.3) 4000 4 1 2000 0 (0%) 0 5910.686 5029.995 594064743
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
treatN 0.364 -19.142 20.045 1.001 6355.341 5685.815
treatNP -0.163 -19.165 19.251 1 6083.197 5521.656
treatP -0.244 -19.599 19.135 1.001 5927.554 5349.261
days.sc -6.236 -21.340 9.210 1 6228.157 5586.199
treatN:days.sc 0.345 -17.673 18.399 1.001 6897.960 5518.289
treatNP:days.sc -4.828 -23.170 13.677 1.001 5910.686 5029.995
treatP:days.sc -2.784 -21.209 16.235 1 6249.623 5434.065

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 = gaussian(),
    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) gaussian (identity) b-normal(0, 10) Intercept-normal(0, 50) sd-student_t(3, 0, 20) sigma-student_t(3, 0, 106.3) 4000 4 1 2000 0 (0%) 0 5277.941 5243.884 978583030
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
pool.nn -0.184 -19.616 19.054 1.001 5764.684 5639.747
days.sc -5.160 -20.929 10.312 1.001 5277.941 5393.331
pool.pp -0.475 -20.052 19.226 1 5491.480 5369.110
pool.nn:days.sc -1.203 -18.698 16.901 1.001 5463.536 5243.884
days.sc:pool.pp -6.661 -23.980 10.693 1 5778.628 5329.551


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")

# 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) 40000 4 1 20000 0 (0%) 0 50056.97 44399.96 1048612606
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.015 -0.135 0.163 1 50056.97 44399.96

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) 40000 4 1 20000 0 (0%) 0 55194.14 44394.02 620083842
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.008 -0.141 0.159 1 55194.14 44394.02

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) 40000 4 1 20000 0 (0%) 0 50554.16 44978.2 1705825401
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.137 -0.706 0.425 1 50554.16 44978.2

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) 40000 4 1 20000 0 (0%) 0 53675.73 43286.97 945490801
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.005 -0.06 0.071 1 53675.73 43286.97

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) 40000 4 1 20000 0 (0%) 0 48766.3 43533.35 758109104
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.118 -0.677 0.429 1 48766.3 43533.35

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) 40000 4 1 20000 0 (0%) 0 50611.52 43737.19 623667626
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.152 -0.724 0.415 1 50611.52 43737.19

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) 40000 4 1 20000 0 (0%) 0 50390.32 41933.96 413707254
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.683 -0.227 1.562 1 50390.32 41933.96

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) 40000 4 1 20000 0 (0%) 0 51303.8 44547.72 1423846020
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0 -0.318 0.313 1 51303.8 44547.72

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) 40000 4 1 20000 0 (0%) 0 51580.4 43697.72 250356946
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.201 -0.424 0.019 1 51580.4 43697.72

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) 40000 4 1 20000 0 (0%) 0 54480.45 45568.53 1495070855
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.271 -0.539 -0.004 1 54480.45 45568.53

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) 40000 4 1 20000 0 (0%) 0 52309.59 45689.58 157324855
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.059 -0.5 0.38 1 52309.59 45689.58

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) 40000 4 1 20000 0 (0%) 0 50427.18 43807.01 61789085
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.061 -0.123 0.241 1 50427.18 43807.01

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) 40000 4 1 20000 0 (0%) 0 48769.08 42562.98 1487964286
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.025 -0.212 0.16 1 48769.08 42562.98

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) 40000 4 1 20000 0 (0%) 0 53007.32 43862.13 1854109569
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.027 -0.16 0.213 1 53007.32 43862.13

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) 40000 4 1 20000 0 (0%) 0 53001.26 44602.74 1300695161
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.442 0.184 0.699 1 53001.26 44602.74

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) 40000 4 1 20000 0 (0%) 0 52333.81 44087.55 1640455467
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.066 -0.29 0.418 1 52333.81 44087.55

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) 40000 4 1 20000 0 (0%) 0 54354.84 43218.54 451859965
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.007 -0.257 0.27 1 54354.84 43218.54

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) 40000 4 1 20000 0 (0%) 0 49937.27 43895.43 479400828
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.039 -0.371 0.291 1 49937.27 43895.43

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) 40000 4 1 20000 0 (0%) 0 53770.81 45621.45 1321964644
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.505 -0.783 -0.23 1 53770.81 45621.45

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) 40000 4 1 20000 0 (0%) 0 53435.49 44457.67 1482520037
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.57 -0.899 -0.243 1 53435.49 44457.67

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) 40000 4 1 20000 0 (0%) 0 50998.96 44714.77 1502704492
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.478 -0.648 -0.31 1 50998.96 44714.77

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) 40000 4 1 20000 0 (0%) 0 52777.3 44489.57 171689187
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.074 -0.026 0.174 1 52777.3 44489.57

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) 40000 4 1 20000 0 (0%) 0 51413.57 44088.83 1.373e+09
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.078 0.023 0.134 1 51413.57 44088.83

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) 40000 4 1 20000 0 (0%) 0 52230.53 45318.31 7447136
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.053 -0.153 0.044 1 52230.53 45318.31

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) 40000 4 1 20000 0 (0%) 0 52556.95 45569.59 1146528163
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.038 -0.138 0.062 1 52556.95 45569.59

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) 40000 4 1 20000 0 (0%) 0 49894.08 45025.61 1168252258
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.065 -0.193 0.319 1 49894.08 45025.61

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) 40000 4 1 20000 0 (0%) 0 51520.78 45357.64 1322327565
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.013 -0.061 0.035 1 51520.78 45357.64

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) 40000 4 1 20000 0 (0%) 0 48680.27 41289.78 101726671
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.104 -0.374 0.163 1 48680.27 41289.78

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) 40000 4 1 20000 0 (0%) 0 48846.28 43402.47 1270710134
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.088 -0.365 0.186 1 48846.28 43402.47

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) 40000 4 1 20000 0 (0%) 0 53927.69 45763.14 1070220198
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.051 -0.142 0.041 1 53927.69 45763.14

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) 40000 4 1 20000 0 (0%) 0 50337.29 43223.91 359163032
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.195 -0.487 0.096 1 50337.29 43223.91

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) 40000 4 1 20000 0 (0%) 0 48893.93 41454.89 876971613
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.069 -1.056 1.159 1 48893.93 41454.89

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) 40000 4 1 20000 0 (0%) 0 49141.2 42952.56 1320258032
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.06 -0.082 0.201 1 49141.2 42952.56

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) 40000 4 1 20000 0 (0%) 0 53613.61 43687.69 836977121
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.055 -0.155 0.262 1 53613.61 43687.69

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) 40000 4 1 20000 0 (0%) 0 53687.01 45391.43 1520224625
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.084 -0.228 0.058 1 53687.01 45391.43

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) 40000 4 1 20000 0 (0%) 0 50876.02 43350.54 2049339314
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.092 -0.418 0.6 1 50876.02 43350.54

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) 40000 4 1 20000 0 (0%) 0 47853.59 43033.11 648824471
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.182 -0.609 0.239 1 47853.59 43033.11

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) 40000 4 1 20000 0 (0%) 0 53940.4 45930.04 945628376
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.056 -0.152 0.264 1 53940.4 45930.04

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) 40000 4 1 20000 0 (0%) 0 51519.4 43660.18 1413138599
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.215 -0.059 0.488 1 51519.4 43660.18

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) 40000 4 1 20000 0 (0%) 0 52450.84 46752.57 1222938933
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.327 -0.724 0.068 1 52450.84 46752.57

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) 40000 4 1 20000 0 (0%) 0 48319.6 42886.46 504747857
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.012 -0.858 0.809 1 48319.6 42886.46

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) 40000 4 1 20000 0 (0%) 0 50297.83 43834.86 221157550
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.11 -0.239 0.46 1 50297.83 43834.86

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) 40000 4 1 20000 0 (0%) 0 55238.75 43657.61 1318796507
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.028 -0.164 0.107 1 55238.75 43657.61

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 5204.431 4445.826 1403189473
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n 0.204 -0.172 0.573 1 5204.431 4445.826

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 5556.934 4711.69 337662742
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.nno.n -0.167 -0.533 0.189 1 5556.934 4711.69

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]

    fam <- Gamma(link = "log")

    if (i %in% c("BS", "Al.sat"))
        fam <- Beta(link = "logit") else 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) 40000 4 1 20000 0 (0%) 0 52815.96 44643.1 1410388778
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.008 -0.082 0.097 1 52815.96 44643.1

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) 40000 4 1 20000 0 (0%) 0 52794.68 46822.58 2133030045
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.022 -0.065 0.11 1 52794.68 46822.58

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) 40000 4 1 20000 0 (0%) 0 47771.71 42911.08 569771158
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.536 0.114 0.953 1 47771.71 42911.08

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) 40000 4 1 20000 0 (0%) 0 52339.14 44798.78 1824816502
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.012 -0.054 0.03 1 52339.14 44798.78

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) 40000 4 1 20000 0 (0%) 0 50338.83 44815.98 504408909
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.17 -0.597 0.249 1 50338.83 44815.98

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) 40000 4 1 20000 0 (0%) 0 52444.94 44483.51 1166263785
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.129 -0.576 0.315 1 52444.94 44483.51

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) 40000 4 1 20000 0 (0%) 0 50973.55 44146.78 1888031748
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.27 -0.606 1.132 1 50973.55 44146.78

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) 40000 4 1 20000 0 (0%) 0 52216.02 44513.83 2015288702
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.163 -0.355 0.027 1 52216.02 44513.83

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) 40000 4 1 20000 0 (0%) 0 51926.47 45063.27 1016965150
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.032 -0.186 0.122 1 51926.47 45063.27

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) 40000 4 1 20000 0 (0%) 0 53118.19 43648.91 129713067
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.051 -0.145 0.246 1 53118.19 43648.91

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) 40000 4 1 20000 0 (0%) 0 53297.85 43143.25 559935875
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.065 -0.392 0.259 1 53297.85 43143.25

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) 40000 4 1 20000 0 (0%) 0 53290.02 45022.28 1471666862
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.013 -0.124 0.097 1 53290.02 45022.28

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) 40000 4 1 20000 0 (0%) 0 51326.73 41936.9 253537481
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.05 -0.161 0.062 1 51326.73 41936.9

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) 40000 4 1 20000 0 (0%) 0 52035.94 45117.31 1298056656
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.074 -0.184 0.036 1 52035.94 45117.31

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) 40000 4 1 20000 0 (0%) 0 51264.29 43462.54 422033495
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.026 -0.242 0.187 1 51264.29 43462.54

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) 40000 4 1 20000 0 (0%) 0 50065.21 43618.49 1820284231
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.109 -0.346 0.128 1 50065.21 43618.49

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) 40000 4 1 20000 0 (0%) 0 51616.77 42053.02 208349016
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.097 -0.266 0.07 1 51616.77 42053.02

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) 40000 4 1 20000 0 (0%) 0 53679.24 46089.57 256697027
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.003 -0.222 0.227 1 53679.24 46089.57

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) 40000 4 1 20000 0 (0%) 0 52979.52 43800.39 458011613
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.099 -0.332 0.134 1 52979.52 43800.39

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) 40000 4 1 20000 0 (0%) 0 51050.87 43038.25 1115811220
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.006 -0.29 0.275 1 51050.87 43038.25

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) 40000 4 1 20000 0 (0%) 0 51580.23 43167.48 424644961
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.036 -0.211 0.14 1 51580.23 43167.48

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 gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 51867.32 46079.65 449266213
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.012 -0.019 0.042 1 51867.32 46079.65

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 gamma (log) b-normal(0, 10) Intercept-normal(0, 50) shape-gamma(0.01, 0.01) 40000 4 1 20000 0 (0%) 0 51764.06 43692.87 808782001
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.003 -0.027 0.032 1 51764.06 43692.87

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) 40000 4 1 20000 0 (0%) 0 53329.79 44767.88 557080911
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.006 -0.054 0.066 1 53329.79 44767.88

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) 40000 4 1 20000 0 (0%) 0 51130.27 44575.58 909676702
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.005 -0.056 0.066 1 51130.27 44575.58

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) 40000 4 1 20000 0 (0%) 0 55070.58 44592.65 1517616170
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.112 -0.042 0.265 1 55070.58 44592.65

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) 40000 4 1 20000 0 (0%) 0 53154.82 41924.48 980893121
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0 -0.035 0.035 1 53154.82 41924.48

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) 40000 4 1 20000 0 (0%) 0 49077.93 43640.13 1877978843
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.112 -0.279 0.055 1 49077.93 43640.13

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) 40000 4 1 20000 0 (0%) 0 49230.4 42944.99 481022454
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.114 -0.286 0.059 1 49230.4 42944.99

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) 40000 4 1 20000 0 (0%) 0 49114.65 43826.35 578047706
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.002 -0.056 0.06 1 49114.65 43826.35

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) 40000 4 1 20000 0 (0%) 0 54872.61 44939.65 1019934469
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.149 -0.358 0.056 1 54872.61 44939.65

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) 40000 4 1 20000 0 (0%) 0 50658.03 41551.49 2007192121
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 1.464 0.607 2.299 1 50658.03 41551.49

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) 40000 4 1 20000 0 (0%) 0 55632.56 45127.43 1682132424
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.006 -0.079 0.092 1 55632.56 45127.43

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) 40000 4 1 20000 0 (0%) 0 51232.56 44039.44 443025579
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.029 -0.1 0.158 1 51232.56 44039.44

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) 40000 4 1 20000 0 (0%) 0 50111.19 42882.31 955637997
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.052 -0.14 0.037 1 50111.19 42882.31

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) 40000 4 1 20000 0 (0%) 0 52371.71 45637.49 2096082951
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.568 0.282 0.856 1 52371.71 45637.49

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) 40000 4 1 20000 0 (0%) 0 51719.29 44508.7 1213893636
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.074 -0.22 0.367 1 51719.29 44508.7

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) 40000 4 1 20000 0 (0%) 0 51844.09 43639.53 678770394
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.029 -0.103 0.16 1 51844.09 43639.53

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) 40000 4 1 20000 0 (0%) 0 52095.78 45142.31 1794541253
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.033 -0.156 0.223 1 52095.78 45142.31

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) 40000 4 1 20000 0 (0%) 0 51929.86 44205.72 1123578253
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.067 -0.247 0.378 1 51929.86 44205.72

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) 40000 4 1 20000 0 (0%) 0 47703.16 41307.24 2114117209
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.11 -0.947 0.724 1 47703.16 41307.24

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) 40000 4 1 20000 0 (0%) 0 50372.42 46346.36 95652643
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.304 0.112 0.496 1 50372.42 46346.36

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) 40000 4 1 20000 0 (0%) 0 48552.37 44552.81 580602680
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.044 -0.033 0.122 1 48552.37 44552.81

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 5281.223 4538.229 914167707
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp 0.555 0.245 0.863 1.001 5281.223 4538.229

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 5187.993 4372.656 1821326262
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_treat.pool.pp -0.525 -0.819 -0.223 1 5187.993 4372.656

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) 40000 4 1 20000 0 (0%) 0 50530.8 42963.66 1164919495
Estimate l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
b_Nrat 0.017 0 0.035 1 50530.8 42963.66

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.51        kableExtra_1.4.0 

loaded via a namespace (and not attached):
 [1] pbapply_1.7-4         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.31        ps_1.9.3             
[28] ragg_1.5.0            purrr_1.2.2           xfun_0.60            
[31] jsonlite_2.0.0        parallel_4.5.2        R6_2.6.1             
[34] stringi_1.8.7         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_7.1.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.7         RcppParallel_5.1.11-2 xml2_1.5.2           
[64] pillar_1.11.1         tensorA_0.36.2.1      packrat_0.9.3        
[67] checkmate_2.3.4       stats4_4.5.2          distributional_0.6.0 
[70] generics_0.1.4        rstantools_2.6.0      scales_1.4.0         
[73] xtable_1.8-8          glue_1.8.1            emmeans_2.0.4        
[76] tools_4.5.2           xaringanExtra_0.8.0   data.table_1.18.2.1  
[79] mvtnorm_1.3-3         grid_4.5.2            tidyr_1.3.2          
[82] ape_5.8-1             QuickJSR_1.9.0        nlme_3.1-168         
[85] cli_3.6.6             textshaping_1.0.4     svUnit_1.0.8         
[88] svglite_2.2.2         Brobdingnag_1.2-9     dplyr_1.2.1          
[91] V8_8.2.0              gtable_0.3.6          digest_0.6.39        
[94] TH.data_1.1-5         htmlwidgets_1.6.4     farver_2.1.2         
[97] htmltools_0.5.9       lifecycle_1.0.5       MASS_7.3-65