calculate_weights: calculate_weights

Description Usage Arguments Value Examples

View source: R/calculate_weights.R

Description

calculate weights for comparison variables based on m and u probabilities estimated from a verified dataset. See https://en.wikipedia.org/wiki/Record_linkage

Usage

1
2
calculate_weights(data, variables, compare_types = "stringdist",
  suffixes = c(".x", ".y"), non_negative = FALSE)

Arguments

data

data.frame. Verified data. Should have all of the variables you want to calculate weights for from both datasets, named the same with data-specific suffixes.

variables

character vector of the variable names of the variables you want to calculate weights for.

suffixes

character vector. Suffixes of of the variables that indicate what data they are from. Default is same as the default for base R merge, c('.x','.y')

non_negative

logical. Do you want to allow negative weights?

compare_type

character vector. One of 'stringdist' (for string variables) 'ratio','difference' (for numerics) 'indicator' (0-1 dummy indicating if the two are the same),'in' (0-1 dummy indicating if data1 is IN data2), and 'substr' (numeric indicating how many digits are the same.)

Value

list with m probabilities, u probabilites, w weights, and settings, the list argument requried as an input for score_settings in merge_plus using the calculate weights.

Examples

1
See match_template.R in examples folder -- end of the file. 

mfriedri12/fedmatch documentation built on Aug. 4, 2017, 7:41 a.m.