Description Usage Arguments Value Examples

View source: R/calculate_weights.R

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

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

`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.) |

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.

1 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.