View source: R/contact-age-distribution.R
| contact_age_distribution | R Documentation |
Returns a data.frame of (age, proportion) pairs representing how
contact ages are distributed in the survey. This can be passed to
assign_age_groups() as estimated_contact_age to impute ages
from ranges using this distribution rather than uniform sampling.
contact_age_distribution(survey)
survey |
a |
a data.frame with columns age (integer) and proportion (numeric,
summing to 1)
data(polymod)
dist <- contact_age_distribution(polymod)
head(dist)
plot(dist$age, dist$proportion, type = "h",
xlab = "Age", ylab = "Proportion")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.