calcMoversPriors: calcMoversPriors

View source: R/calcMoversPriors.R

calcMoversPriorsR Documentation

calcMoversPriors

Description

calcMoversPriors calculates prior estimates of in-state and cross-state movers rates from the IRS SOI Migration data, which can be used to improve the accuracy of the EM algorithm.

Usage

calcMoversPriors(geo.a, geo.b, year.start, year.end,
county, state.a, state.b, matchrate.lambda, remove.instate)

Arguments

geo.a

The state code (if state = TRUE) or county name (if state = FALSE) for the earlier of the two voter files.

geo.b

The state code (if state = TRUE) or county name (if state = FALSE) for the later of the two voter files.

year.start

The year of the voter file for geography A.

year.end

The year of the voter file for geography B.

county

Whether prior is being calculated on the county or state level. Default is FALSE (for a state-level calculation).

state.a

If county = TRUE (indicating a county-level match), the state code of geo.a. Default is NULL.

state.b

If county = TRUE (indicating a county-level match), the state code of geo.b. Default is NULL.

matchrate.lambda

If TRUE, then returns the match rate for lambda (the expected share of observations in dataset A that can be found in dataset B). If FALSE, then returns the expected share of matches across all pairwise comparisons of datasets A and B. Default is FALSE

remove.instate

If TRUE, then for calculating cross-state movers rates assumes that successful matches have been subsetted out. The interpretation of the prior is then the match rate conditional on being an out-of-state or county mover. Default is TRUE.

Value

calcMoversPriors returns a list with estimates of the expected match rate, and of the expected in-state movers rate when matching within-state.

Author(s)

Ben Fifield <benfifield@gmail.com>

Examples

calcMoversPriors(geo.a = "CA", geo.b = "CA", year.start = 2014, year.end = 2015)


fastLink documentation built on Nov. 17, 2023, 9:06 a.m.