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.
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.
Returns
calcMoversPriors returns a list with estimates of the expected match rate, and of the expected in-state movers rate when matching within-state.