% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/contact-age-distribution.R
\name{contact_age_distribution}
\alias{contact_age_distribution}
\title{Extract the empirical age distribution of contacts from a survey}
\usage{
contact_age_distribution(survey)
}
\arguments{
\item{survey}{a \code{\link[=survey]{survey()}} object}
}
\value{
a data.frame with columns \code{age} (integer) and \code{proportion} (numeric,
summing to 1)
}
\description{
Returns a data.frame of (age, proportion) pairs representing how
contact ages are distributed in the survey. This can be passed to
\code{\link[=assign_age_groups]{assign_age_groups()}} as \code{estimated_contact_age} to impute ages
from ranges using this distribution rather than uniform sampling.
}
\examples{
data(polymod)
dist <- contact_age_distribution(polymod)
head(dist)
plot(dist$age, dist$proportion, type = "h",
     xlab = "Age", ylab = "Proportion")

}
