% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/postprocess-matrix.R
\name{per_capita}
\alias{per_capita}
\title{Convert a contact matrix to per-capita rates}
\usage{
per_capita(x, survey_pop, ...)
}
\arguments{
\item{x}{a list as returned by \code{\link[=compute_matrix]{compute_matrix()}}, with elements \code{matrix}
and \code{participants}}

\item{survey_pop}{a data frame with columns \code{lower.age.limit} and
\code{population} (e.g. from \code{\link[=wpp_age]{wpp_age()}})}

\item{...}{passed to \code{\link[=pop_age]{pop_age()}} for interpolation}
}
\value{
\code{x} with \verb{$matrix} replaced by the per-capita version
}
\description{
Divides each column of the contact matrix by the population of the
corresponding age group, giving the contact rate of age group i with
one individual of age group j.
}
\examples{
data(polymod)
pop <- wpp_age("United Kingdom", 2005)
polymod |>
  (\(s) s[country == "United Kingdom"])() |>
  assign_age_groups(age_limits = c(0, 5, 15)) |>
  compute_matrix() |>
  per_capita(survey_pop = pop)

}
