modfuns: Internal model fitting functions

modfunsR Documentation

Internal model fitting functions

Description

These functions are intended for internal use only. Users should use the race_predict interface rather any of these functions directly.

Usage

.predict_race_old(
  voter.file,
  census.surname = TRUE,
  surname.only = FALSE,
  surname.year = 2010,
  name.dictionaries = NULL,
  census.geo,
  census.key,
  census.data = NULL,
  age = FALSE,
  sex = FALSE,
  year = "2010",
  party,
  retry = 3,
  impute.missing = TRUE,
  use.counties = FALSE
)

predict_race_new(
  voter.file,
  names.to.use,
  year = "2010",
  age = FALSE,
  sex = FALSE,
  census.geo,
  census.key = NULL,
  name.dictionaries,
  surname.only = FALSE,
  census.data = NULL,
  retry = 0,
  impute.missing = TRUE,
  census.surname = FALSE,
  use.counties = FALSE
)

predict_race_me(
  voter.file,
  names.to.use,
  year = "2010",
  age = FALSE,
  sex = FALSE,
  census.geo,
  census.key,
  name.dictionaries,
  surname.only = FALSE,
  census.data = NULL,
  retry = 0,
  impute.missing = TRUE,
  census.surname = FALSE,
  use.counties = FALSE,
  race.init,
  ctrl
)

Arguments

voter.file

See documentation in race_predict.

census.surname

See documentation in race_predict.

surname.only

See documentation in race_predict.

surname.year

See documentation in race_predict.

name.dictionaries

See documentation in race_predict.

census.geo

See documentation in race_predict.

census.key

See documentation in race_predict.

census.data

See documentation in race_predict.

age

See documentation in race_predict.

sex

See documentation in race_predict.

year

See documentation in race_predict.

party

See documentation in race_predict.

retry

See documentation in race_predict.

impute.missing

See documentation in race_predict.

use.counties

A logical, defaulting to FALSE. Should census data be filtered by counties available in census.data?

names.to.use

See documentation in race_predict.

race.init

See documentation in race_predict.

ctrl

See control in documentation for race_predict.

Details

These functions fit different versions of WRU. .predict_race_old fits the original WRU model, also known as BISG with census-based surname dictionary. .predict_race_new fits a new version of BISG which uses a new, augmented surname dictionary, and can also accommodate the use of first and middle name information. Finally, .predict_race_me fits a fully Bayesian Improved Surname Geocoding model (fBISG), which fits a model with measurement-error correction of erroneous zeros in census tables, in addition to also accommodating the augmented surname dictionary, and the first and middle name dictionaries when making predictions.

Value

See documentation in race_predict.

.predict_race_old

Original WRU race prediction function, implementing classical BISG with census-based surname dictionary.

.predict_race_new

New race prediction function, implementing classical BISG with augmented surname dictionary, as well as first and middle name information.

.predict_race_me

New race prediction function, implementing fBISG (i.e. measurement error correction, fully Bayesian model) with augmented surname dictionary, as well as first and middle name information.


wru documentation built on Oct. 22, 2022, 1:05 a.m.

Related to modfuns in wru...