tableCounts: tableCounts

View source: R/tableCounts.R

tableCountsR Documentation

tableCounts

Description

Count pairs with the same pattern in the cross product between two datasets.

Usage

tableCounts(gammalist, nobs.a, nobs.b, n.cores)

Arguments

gammalist

A list of objects produced by gammaKpar, gammaCK2par, or gammaCKpar.

nobs.a

number of observations in dataset 1

nobs.b

number of observations in dataset 2

n.cores

Number of cores to parallelize over. Default is NULL.

Value

tableCounts returns counts of all unique mathching patterns, which can be fed directly into emlinkMAR to get posterior matching probabilities for each unique pattern.

Author(s)

Ted Enamorado <ted.enamorado@gmail.com>, Ben Fifield <benfifield@gmail.com>, and Kosuke Imai

Examples

## Not run: 
## Calculate gammas
g1 <- gammaCKpar(dfA$firstname, dfB$firstname)
g2 <- gammaCKpar(dfA$middlename, dfB$middlename)
g3 <- gammaCKpar(dfA$lastname, dfB$lastname)
g4 <- gammaKpar(dfA$birthyear, dfB$birthyear)

## Run tableCounts
tc <- tableCounts(list(g1, g2, g3, g4), nobs.a = nrow(dfA), nobs.b = nrow(dfB))

## End(Not run)

fastLink documentation built on Nov. 17, 2023, 9:06 a.m.