View source: R/predict_biomass.R
| predict_biomass | R Documentation |
Wraps predict() for every kind of model full_estimation_table() can fit,
and returns the biomass of a whole row on the scale of the supplied data
predict_biomass(model, size, abundance)
model |
A fitted allometric model |
size |
The size to estimate biomass for |
abundance |
The number of individuals the row holds |
Both kinds return a confidence interval, i.e. the uncertainty around the mean predicted biomass. The estimate is scaled to the abundance of the row while still on the scale the model was fitted on (log10 for an lm, the log link for a Poisson glm), and then back-transformed.
Three values: the biomass estimate, its lower and its upper bound
# Any allometric model will do
mod <-
lm(log10(biomass_col) ~ log10(size_col),
data = data.frame(size_col = c(1, 2, 3, 4, 5),
biomass_col = c(0.1, 0.5, 1.2, 2.4, 4.1)))
# Biomass of a row holding ten individuals of size 3, with its bounds
predict_biomass(mod, size = 3, abundance = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.