library(tidyverse)
library(broom)
library(TOSTER)
library(boot)
tree <- read_csv(paste0(my_wd, "data/fia_tree_carbon.csv"))If you work with forest carbon, you’ve probably heard colleagues discussing the different allometric equations used to predict carbon. If you’re comparing one of more equations, how do you know if the estimates are significantly different or close enough to be treated as interchangeable?
This question was the focus of the second session of Arbor Lab, a live-coding session streamed on YouTube. In this session, we compared forest carbon estimates from three approaches to estimating tree carbon in the US, then compared them using three different statistical tests. This post walks through the same workflow so you can run it yourself. The code and data are also available on GitHub.
Three ways to estimate tree carbon
The tree-level carbon values can come from several equations or modeling systems. We’ll compare three:
- Jenkins: national-scale biomass equations that predict tree biomass from diameter by species group (Jenkins et al. 2003).
- CRM (Component Ratio Method): an approach previously used in the Forest Inventory and Analysis (FIA) program, which builds biomass up from tree volume and ratios for each tree component (Woodall et al. 2011). Its models relied on different regions split by administrative boundaries.
- NSVB (National-Scale Volume and Biomass): the newer modeling system that estimates volume, biomass, and carbon in a consistent way, and that relies on ecological divisions rather than administrative boundaries (Westfall et al. 2024).
The goal of this post is to compare the three estimates of forest carbon using three quantitative approaches. I’ll focus on a comparison between Jenkins and NSVB in spruce-fir forests, but the same code works for any pair of methods and any forest type.
The data
We’re using FIA data from New York State, measured between 2019 and 2025. The file fia_tree_carbon.csv contains live trees with their measurements and tree-level carbon estimates from each of the three methods (in kg C per tree). The data come from two forest types:
- 89 oak-hickory plots in the Catskills-Lower Hudson Valley region
- 65 spruce-fir plots in the Adirondacks
Let’s load the packages we need and read in the data.
What trees are in the data?
Before comparing equations, it helps to know which species are driving the numbers. Here are the 10 most common species within each forest type:
tree_spp <- tree |>
group_by(forest_type, COMMON_NAME) |>
summarize(num_trees = n()) |>
arrange(desc(num_trees)) |>
slice(1:10)
tree_spp# A tibble: 20 × 3
# Groups: forest_type [2]
forest_type COMMON_NAME num_trees
<chr> <chr> <int>
1 Oak-hickory red maple 425
2 Oak-hickory northern red oak 396
3 Oak-hickory chestnut oak 321
4 Oak-hickory white oak 193
5 Oak-hickory eastern white pine 188
6 Oak-hickory sweet birch 185
7 Oak-hickory sugar maple 180
8 Oak-hickory eastern hemlock 112
9 Oak-hickory scarlet oak 89
10 Oak-hickory black oak 76
11 Spruce-fir balsam fir 1652
12 Spruce-fir red spruce 999
13 Spruce-fir red maple 265
14 Spruce-fir paper birch 218
15 Spruce-fir northern white-cedar 187
16 Spruce-fir black spruce 84
17 Spruce-fir tamarack 66
18 Spruce-fir black cherry 48
19 Spruce-fir yellow birch 48
20 Spruce-fir eastern hemlock 27
Red maple and northern red oak are most common in the oak-hickory forest type, while balsam fir and red spruce are common in the spruce-fir forest type. And here is a plot of the species:
ggplot(tree_spp, aes(x = reorder(COMMON_NAME, num_trees), y = num_trees)) +
geom_bar(stat = "identity") +
facet_wrap(~ forest_type, scales = "free_y") +
labs(x = "Species", y = "Number of trees") +
coord_flip() +
theme_bw() +
theme(axis.text.y = element_text(size = 14))
Species mix matters here because each of the three systems handles species differently. The Jenkins equations group all species into one of ten species groups, while NSVB fits models by species or species group, so the equations can diverge more for some species than others.
From trees to plots
Tree-level carbon is interesting, but most of us report carbon on a per-unit area basis. We’ll scale up to the plot level in three steps:
- Multiplying each tree’s carbon by its expansion factor (
TPA_UNADJ) to get carbon per acre. - Convert kilograms to metric tons (
* 0.001). - Convert carbon to carbon dioxide equivalent (
* 3.664).
We’ll do this once for each of the three methods, so every plot has three estimates in units of metric tons CO2e per acre.
stand <- tree |>
group_by(forest_type, STATECD, COUNTYCD, PLOT, INVYR) |>
summarize(jenkins = sum(carbon_total_jenkins * TPA_UNADJ) * 0.001 * 3.664,
crm = sum(carbon_total_crm * TPA_UNADJ) * 0.001 * 3.664,
nsvb = sum(carbon_total_nsvb * TPA_UNADJ) * 0.001 * 3.664)Each row is a plot with a carbon estimate from each method. That “paired” structure, where the same plot is estimated three ways, is important for the tests below.
Visualizing the differences
To plot with ggplot2, we need the data in “long” format, with one row per plot and method. pivot_longer() does that:
stand_long <- stand |>
pivot_longer(cols = c(jenkins, crm, nsvb),
names_to = "method", values_to = "carbon")Now we’ll make a density plot of carbon by method and forest type:
ggplot(stand_long, aes(x = carbon, fill = method, color = method)) +
geom_density(alpha = 0.3) +
facet_wrap(~ forest_type) +
labs(x = "Carbon (mtCO2e/ac)",
y = "Density",
fill = "Method",
color = "Method") +
theme_bw() +
theme(legend.text = element_text(size = 14),
strip.text = element_text(size = 14))
Look at where the peaks sit and how much the curves overlap within each forest type. The three estimates for the oak-hickory forests look similar, while the spruce-fir forest type has more differences. For the rest of the post we’ll focus on spruce-fir stands:
stand_sf <- stand |>
filter(forest_type == "Spruce-fir")Method 1: A classic statistical test (t-test)
The first approach is the one most of us learned probably learned in a statistics class. For each plot, we calculate the difference between two estimates (here, Jenkins − NSVB), and then test whether the mean of those differences is zero. Because the same plots are measured by both methods, this is a paired t-test.
The test has two assumptions: the differences are roughly normally distributed, and the plots are independent of each other. We can check the first with a normal Q-Q plot of the differences. If the points fall near the red line, the normality assumption is reasonable:
ggplot(stand_sf, aes(sample = jenkins - nsvb)) +
stat_qq() +
stat_qq_line(color = "red") +
labs(x = "Theoretical quantiles",
y = "Sample quantiles (Jenkins − NSVB, mtCO2e/ac)",
title = "Normal Q-Q plot") +
theme_bw()
Then we run the test with t.test() and paired = TRUE:
tt <- t.test(stand_sf$jenkins, stand_sf$nsvb, paired = TRUE)
tt
Paired t-test
data: stand_sf$jenkins and stand_sf$nsvb
t = 9.1853, df = 64, p-value = 2.689e-13
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
16.68858 25.96554
sample estimates:
mean difference
21.32706
The output gives the mean of the differences (21.3 mtCO2e/ac) and a 95% confidence interval (16.7 to 26). The p-value (2.7e-13) is less than the classic level of significance of 0.05, so we can say that the two carbon estimates are significantly different.
Method 2: Equivalence tests
A slightly different question is: are two estimates close enough to be interchangeable? Instead of “no difference,” the null hypothesis in an equivalence test is that the true difference is outside a margin we specify. The alternative hypothesis is that the true difference falls within that margin. This is done with two one-sided tests (TOST): one tests that the difference is above the lower bound, the other that it’s below the upper bound. If both are rejected, we conclude the estimates are equivalent.
The hard part is the margin. It has to come from your application: how much difference would you tolerate before the choice of equation changes a decision? Here, we’ll define it as 20% of the standard deviation of the paired differences:
delta <- sd(stand_sf$jenkins - stand_sf$nsvb) * 0.2
delta[1] 3.743914
The tsum_TOST() function in the TOSTER package runs the test from summary statistics (means, standard deviations, and sample sizes), with the bounds set to +/- delta:
tost_result <- tsum_TOST(
m1 = mean(stand_sf$jenkins),
sd1 = sd(stand_sf$jenkins),
n1 = nrow(stand_sf),
m2 = mean(stand_sf$nsvb),
sd2 = sd(stand_sf$nsvb),
n2 = nrow(stand_sf),
low_eqbound = -delta,
high_eqbound = delta,
eqbound_type = "raw"
)
tost_result
Welch Two Sample t-test
The equivalence test was non-significant, t(126.19) = 2.122, p = 9.82e-01
The null hypothesis test was significant, t(126.19) = 2.574, p = 1.12e-02
NHST: reject null significance hypothesis that the effect is equal to zero
TOST: don't reject null equivalence hypothesis
TOST Results
t df p.value
t-test 2.574 126.2 0.011
TOST Lower 3.026 126.2 0.002
TOST Upper 2.122 126.2 0.982
Effect Sizes
Estimate SE C.I. Conf. Level
Raw 21.3271 8.286 [7.5965, 35.0576] 0.9
Hedges's g(av) 0.4488 0.179 [0.1574, 0.7384] 0.9
Note: SMD confidence intervals are an approximation. See vignette("SMD_calcs").
The output reports the classic t-test along with the two one-sided tests. Equivalence is declared when both one-sided p-values are below the significance level. In this example, only the lower bound is below the significance level.
Here is a plot of the confidence interval from the paired t-test (tidied with the broom package) plotted with the equivalence region. If the interval sits entirely inside the shaded band, the estimates are equivalent at the margin we chose:
tt95 <- t.test(stand_sf$jenkins, stand_sf$nsvb, paired = TRUE) |>
tidy()
ggplot(tt95, aes(y = "Jenkins − NSVB")) +
annotate("rect", xmin = -delta, xmax = delta, ymin = -Inf, ymax = Inf,
fill = "blue", alpha = 0.2) +
geom_vline(xintercept = 0, linetype = "dashed") +
geom_pointrange(aes(x = estimate, xmin = conf.low, xmax = conf.high),
linewidth = 0.8, size = 0.8) +
scale_x_continuous(limits = c(-delta * 1.5, max(tt95$conf.high, delta) * 1.2)) +
labs(x = "Mean difference (mtCO2e/ac)", y = NULL,
title = "Equivalence test (TOST)",
caption = "Shaded = equivalence region (+/- delta)") +
theme_bw()
For this margin, the equivalence region is ±3.7 mtCO2e/ac, falling outside the equivalence region. The framing of questions used in equivalence tests aligns with how we often compare equations in forestry.
Method 3: Bootstrapped resampling
Both previous tests lean on a statistical distribution and all of the assumptions behind it. Bootstrapping skirts the normality requirement by using the data themselves. In this method, we can resample the plots with replacement a large number of times (5,000 here), recompute the mean each time, and use the spread of those resampled means to build a confidence interval. The 2.5th and 97.5th percentiles of the resampled means form a 95% percentile confidence interval.
With the boot package, we first write a function that returns the statistic we care about, and it takes the data and a set of indices to resample:
boot_mean <- function(data, indices) {
mean(data[indices])
}Next, we’ll write a function that runs the bootstrap, calculates the percentile interval, and returns a tidy one-row summary. Setting a seed makes the results reproducible:
set.seed(11262026)
run_boot_ci <- function(data, label, R = 5000) {
b <- boot(data = data, statistic = boot_mean, R = R)
ci <- boot.ci(b, type = "perc")
tibble(
dataset = label,
boot_mean = mean(b$t),
lower_95 = ci$percent[4],
upper_95 = ci$percent[5]
)
}We’ll run it three times: on the Jenkins estimates, on the NSVB estimates, and on their paired difference.
boot_jenkins <- run_boot_ci(stand_sf$jenkins, "Jenkins")
boot_nsvb <- run_boot_ci(stand_sf$nsvb, "NSVB")
boot_combined <- run_boot_ci(stand_sf$jenkins - stand_sf$nsvb, "Difference")
boot_summary <- rbind(boot_jenkins, boot_nsvb, boot_combined)
boot_summary# A tibble: 3 × 4
dataset boot_mean lower_95 upper_95
<chr> <dbl> <dbl> <dbl>
1 Jenkins 124. 112. 136.
2 NSVB 103. 91.7 114.
3 Difference 21.2 17.0 25.8
Then we can plot the bootstrapped means with their 95% intervals:
boot_summary <- boot_summary |>
mutate(dataset = factor(dataset, levels = c("Difference", "Jenkins", "NSVB")))
ggplot(boot_summary, aes(x = dataset, y = boot_mean, color = dataset)) +
geom_point(size = 3) +
geom_errorbar(aes(ymin = lower_95, ymax = upper_95), width = 0.15, linewidth = 0.8) +
geom_text(aes(label = sprintf("%.1f", boot_mean)),
vjust = -1.2, size = 3.5, show.legend = FALSE) +
labs(title = "Bootstrapped 95% confidence intervals",
caption = "Bootstrap mean with 95% confidence intervals",
x = NULL,
y = "Mean CO2 (mtCO2-e/ac)") +
coord_flip() +
theme_bw() +
theme(legend.position = "none",
axis.text = element_text(size = 14),
plot.title = element_text(face = "bold"))
Here, the intervals for the Jenkins and NSVB means overlap. But more informative, the interval for the difference between the two does not include 0.include zero? Here the bootstrapped mean difference is 21.2 mtCO2e/ac, with a 95% interval of 17 to 25.8 mtCO2e/ac.
Which approach should you use?
Each method answers a slightly different question:
| Method | Question it answers | Watch out for |
|---|---|---|
| Paired t-test | Is the mean difference zero? | Assumes roughly normal differences and independent plots. With many plots, tiny differences become “significant.” |
| Equivalence test (TOST) | Is the mean difference within a margin I can live with? | You need to justify the margin. |
| Bootstrap | What’s the plausible range for the mean (or the mean difference), without assuming a distribution? | Still assumes plots are a representative, independent sample. |
In practice, I like running several of these approaches, but I’m leaning to using bootstrapping more often. The t-test is familiar and is what many quantitatively-minded decision makers expect. Equivalence testing frames the result around practical importance. Bootstrap gives you a distribution-free check on both. When they point in the same direction, you can be more confident in your conclusion about assessing differences.
For next steps, try changing the pairs of methods (CRM vs. NSVB, say), the forest type, or the margin, and see how the results respond. The oak-hickory plots are a good second case, since the equations are based on different species and the three estimates seem much closer to one another compared to the spruce-fir forest type..
Thanks to everyone who joined the livestream session. We’ll continue to do them every month. The best way to keep informed about them is by following the Arbor Analytics LinkedIn page.
By Matt Russell, Principal and Lead Data Scientist at Arbor Analytics. Subscribe to our monthly email newsletter for data and analytics trends in the forest products industry. We send one email on the last Thursday of every month.