% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict_biomass.R
\name{predict_biomass}
\alias{predict_biomass}
\title{Estimate biomass from a fitted allometric model}
\usage{
predict_biomass(model, size, abundance)
}
\arguments{
\item{model}{A fitted allometric model}

\item{size}{The size to estimate biomass for}

\item{abundance}{The number of individuals the row holds}
}
\value{
Three values: the biomass estimate, its lower and its upper bound
}
\description{
Wraps \code{predict()} for every kind of model \code{full_estimation_table()} can fit,
and returns the biomass of a whole row on the scale of the supplied data
}
\details{
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.
}
\examples{
# 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)
}
