best_age_mixing: Return best-fitting mixing structure

Description Usage Arguments Value

Description

A convenience function - calculates the likelihood of observing the provided data under each mixing structure provided in estimate_age_mixing. See mixageestimate_age_mixing for more details.

Usage

1
2
best_age_mixing(choice_data, start_ages, max_age = 74,
  age_distribution = NULL)

Arguments

choice_data

a dataframe with chooser age, partner age, sex, and optional survey weights. These columns should be named chsage, ptage, sex, and weights, respectively. Sex must be coded as "Male" and "Female"

start_ages

vector of the youngest ages included in each age group. If start_ages is c(12, 20, 30), the age groups are 12-19, 20-29, and 30 to max_age - 1.

max_age

The non-inclusive right-hand endpoint of the oldest age group within the model population. Default is 74, so if the oldest age group begins at 60, the age interval is 60-73. Must be less than or equal to 100.

age_distribution

Optional: a vector of length length(seq(min(start_ages), max_age)), where the ith entry is the proportion of the model population with age i. This vector defines the proportion of the model population with every age, not age group. If not provided, the 2011 U.S. life tables are used to estimate the population age distribution.

Value

A list with the following elements:

  1. all_AIC: the Akaike information criterion for each model

  2. best_structure: the best-fitting model


caleb-easterly/mixage documentation built on May 12, 2019, 4:25 p.m.