tabulate_patterns function

Create a table of comparison patterns

Create a table of comparison patterns

## S3 method for class 'cluster_pairs' tabulate_patterns(pairs, on, comparators, complete = TRUE, ...) tabulate_patterns(pairs, on, comparators, complete = TRUE, ...) ## S3 method for class 'pairs' tabulate_patterns(pairs, on, comparators, complete = TRUE, ...)

Arguments

  • pairs: a pairs object, such as generated by pair_blocking
  • on: variables from pairs defining the comparison patterns. When missing names(comparators) is used.
  • comparators: a list with comparison functions for each of the columns. When missing or NULL, the function looks for columns in pairs with a comparator attribute.
  • complete: add patterns that do not occur in the dataset to the result (with n = 0).
  • ...: passed on to other methods.

Returns

Returns a data.frame with all unique comparison patterns that exist in pairs, with a column n added with the number of times each pattern occurs.

Details

Since comparison vectors can contain continuous numbers (usually between 0 and 1), this could result in a very large number of possible comparison vectors. Therefore, the comparison vectors are passed on to the comparators in order to threshold them. This usually results in values 0 or 1. Missing values are usually codes as 0. However, this all depends on the comparison functions used. For more information see the documentation on the comparison functions .

Examples

data("linkexample1", "linkexample2") pairs <- pair_blocking(linkexample1, linkexample2, "postcode") pairs <- compare_pairs(pairs, c("lastname", "firstname", "address", "sex")) tabulate_patterns(pairs)
  • Maintainer: Jan van der Laan
  • License: GPL-3
  • Last published: 2024-02-09