diff --git a/R/dedupeMatches.R b/R/dedupeMatches.R index 1ac840c..6d35af2 100644 --- a/R/dedupeMatches.R +++ b/R/dedupeMatches.R @@ -100,201 +100,207 @@ dedupeMatches <- function(matchesA, matchesB, EM, matchesLink, }else{ gammalist[[i]] <- ifelse(tmp >= cut.a, 2, 0) } - }else{ - tmp <- matchesA[,varnames[i]] == matchesB[,varnames[i]] - gammalist[[i]] <- ifelse(tmp == TRUE, 2, 0) - } - - namevec[i] <- paste0("gamma.", i) - - } - gammalist <- data.frame(do.call(cbind, gammalist)) - names(gammalist) <- namevec - - ## ------------------------------- - ## Convert EM object to data frame - ## ------------------------------- - emdf <- as.data.frame(EM$patterns.w) - emdf$zeta.j <- c(EM$zeta.j) - - ## --------------------- - ## Merge EM to gammalist - ## --------------------- - matchesA <- cbind(matchesA, gammalist) - matchesB <- cbind(matchesB, gammalist) - matchesA$roworder <- 1:nrow(matchesA) - matchesB$roworder <- 1:nrow(matchesB) - matchesA <- merge(matchesA, emdf, by = namevec, all.x = TRUE) - matchesB <- merge(matchesB, emdf, by = namevec, all.x = TRUE) - matchesA <- matchesA[order(matchesA$roworder),] - matchesB <- matchesB[order(matchesB$roworder),] - - ## ------------ - ## Start dedupe - ## ------------ - ## Ids - matchesA$idA <- matchesLink$inds.a - matchesB$idB <- matchesLink$inds.b - matchesB$idA <- matchesA$idA - matchesA$idB <- matchesB$idB - - ## Remove observations with NA for zeta.j - matchesA <- matchesA[!is.na(matchesA$zeta.j),] - matchesB <- matchesB[!is.na(matchesB$zeta.j),] - - if(!linprog){ - - ## Step 1: Find max zeta for each observation in dataset A: - ## Merge in maximum zeta for each observation in dataset A - temp <- as.matrix(tapply(matchesA$zeta.j, matchesA$idA, max, na.rm = T)) - temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) - names(temp) <- c("idA", "zeta.max") - matchesA <- merge(matchesA, temp, by = "idA") - - ## Calculate difference - matchesA <- matchesA[order(matchesA$roworder), ] - matchesB <- matchesB[order(matchesB$roworder), ] - matchesA$rm <- abs(matchesA$zeta.j - matchesA$zeta.max) - rm <- which(matchesA$rm == 0) - - ## Subset down to max zetas - matchesA <- matchesA[rm, ] - matchesB <- matchesB[rm, ] - - ## Step 2: Find max zeta for each observation in dataset B, if in first subset: - ## Merge in maximum zeta for each observation in dataset B - temp <- as.matrix(tapply(matchesB$zeta.j, matchesB$idB, max, na.rm = T)) - temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) - names(temp) <- c("idB", "zeta.max") - matchesB <- merge(matchesB, temp, by = "idB") - - ## Calculate difference - matchesA <- matchesA[order(matchesA$roworder), ] - matchesB <- matchesB[order(matchesB$roworder), ] - matchesB$rm <- abs(matchesB$zeta.j - matchesB$zeta.max) - rm <- which(matchesB$rm == 0) - - ## Subset down to max zetas - matchesA <- matchesA[rm, ] - matchesB <- matchesB[rm, ] - - ## Step 3: Break remaining ties - ## Find remaining duplicates in A - d1 <- duplicated(matchesA$idA) - d2 <- duplicated(matchesA$idA, fromLast = T) - matchesA$dA <- ifelse((d1 + d2) > 0, 1, 0) - matchesB$dA <- ifelse((d1 + d2) > 0, 1, 0) - - ## Draw uniform to break tie, and merge in - matchesA$uni <- runif(nrow(matchesA)) - temp <- as.matrix(tapply(matchesA$uni, matchesA$idA, max, na.rm = T)) - temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) - names(temp) <- c("idA", "uni.max") - matchesA <- merge(matchesA, temp, by = "idA") - matchesA <- matchesA[order(matchesA$roworder), ] - matchesB <- matchesB[order(matchesB$roworder), ] - matchesA$rm <- abs(matchesA$uni - matchesA$uni.max) - rm <- which(matchesA$rm == 0) - - ## Subset down to broken tie - matchesA <- matchesA[rm, ] - matchesB <- matchesB[rm, ] - }else{ + tmp <- matchesA[,varnames[i]] == matchesB[,varnames[i]] + gammalist[[i]] <- ifelse(tmp == TRUE, 2, 0) + } - ## Find duplicates - dupA <- duplicated(matchesA$idA) - dupB <- duplicated(matchesA$idA, fromLast = T) - matchesA$dupA <- ifelse(dupA == 1 | dupB == 1, 1, 0) - - dupA <- duplicated(matchesB$idB) - dupB <- duplicated(matchesB$idB, fromLast = T) - matchesA$dupB <- ifelse(dupA == 1 | dupB == 1, 1, 0) - - ## Split into dupes, not dups - dups <- subset(matchesA, dupA == 1 | dupB == 1) - nodups <- subset(matchesA, dupA == 0 & dupB == 0) - - dups$idA.t <- as.numeric(as.factor(dups$idA)) - dups$idB.t <- as.numeric(as.factor(dups$idB)) - - nr <- max(dups$idA.t) - nc <- max(dups$idB.t) - dim <- max(nr, nc) - - ## Create adjacency matrix to id duplicates - mat.adj <- sparseMatrix(i = dups$idA.t, j = dups$idB.t, x = dups$zeta.j, - dims = c(dim, dim)) - mat.adj <- as.matrix(mat.adj) - - ## Solve linear sum assignment problem - T1 <- suppressWarnings(assignment(-mat.adj)) - temp.0 <- cbind(1:dim, T1$perm) - n1 <- which(rowSums(mat.adj) == 0) - n2 <- which(colSums(mat.adj) == 0) - - if(length(n1) > 0) { - temp.0 <- temp.0[-n1, ] - } - - if(length(n2) > 0) { - temp.0 <- temp.0[, -n2] - } - - temp.0 <- data.frame(temp.0) - names(temp.0) <- c("idA.t", "idB.t") + namevec[i] <- paste0("gamma.", i) + + } + gammalist <- data.frame(do.call(cbind, gammalist)) + names(gammalist) <- namevec + + ## ------------------------------- + ## Convert EM object to data frame + ## ------------------------------- + emdf <- as.data.frame(EM$patterns.w) + emdf$zeta.j <- c(EM$zeta.j) + + ## --------------------- + ## Merge EM to gammalist + ## --------------------- + matchesA <- cbind(matchesA, gammalist) + matchesB <- cbind(matchesB, gammalist) + matchesA$roworder <- 1:nrow(matchesA) + matchesB$roworder <- 1:nrow(matchesB) + matchesA <- merge(matchesA, emdf, by = namevec, all.x = TRUE) + matchesB <- merge(matchesB, emdf, by = namevec, all.x = TRUE) + matchesA <- matchesA[order(matchesA$roworder),] + matchesB <- matchesB[order(matchesB$roworder),] + + ## ------------ + ## Start dedupe + ## ------------ + ## Ids + matchesA$idA <- matchesLink$inds.a + matchesB$idB <- matchesLink$inds.b + matchesB$idA <- matchesA$idA + matchesA$idB <- matchesB$idB + + ## Remove observations with NA for zeta.j + matchesA <- matchesA[!is.na(matchesA$zeta.j),] + matchesB <- matchesB[!is.na(matchesB$zeta.j),] + + if(!linprog){ + + ## Step 1: Find max zeta for each observation in dataset A: + ## Merge in maximum zeta for each observation in dataset A + temp <- as.matrix(tapply(matchesA$zeta.j, matchesA$idA, max, na.rm = T)) + temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) + names(temp) <- c("idA", "zeta.max") + matchesA <- merge(matchesA, temp, by = "idA") + + ## Calculate difference + matchesA <- matchesA[order(matchesA$roworder), ] + matchesB <- matchesB[order(matchesB$roworder), ] + matchesA$rm <- abs(matchesA$zeta.j - matchesA$zeta.max) + rm <- which(matchesA$rm == 0) + + ## Subset down to max zetas + matchesA <- matchesA[rm, ] + matchesB <- matchesB[rm, ] + + ## Step 2: Find max zeta for each observation in dataset B, if in first subset: + ## Merge in maximum zeta for each observation in dataset B + temp <- as.matrix(tapply(matchesB$zeta.j, matchesB$idB, max, na.rm = T)) + temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) + names(temp) <- c("idB", "zeta.max") + matchesB <- merge(matchesB, temp, by = "idB") + + ## Calculate difference + matchesA <- matchesA[order(matchesA$roworder), ] + matchesB <- matchesB[order(matchesB$roworder), ] + matchesB$rm <- abs(matchesB$zeta.j - matchesB$zeta.max) + rm <- which(matchesB$rm == 0) + + ## Subset down to max zetas + matchesA <- matchesA[rm, ] + matchesB <- matchesB[rm, ] + + ## Step 3: Break remaining ties + ## Find remaining duplicates in A + d1 <- duplicated(matchesA$idA) + d2 <- duplicated(matchesA$idA, fromLast = T) + matchesA$dA <- ifelse((d1 + d2) > 0, 1, 0) + matchesB$dA <- ifelse((d1 + d2) > 0, 1, 0) + + ## Draw uniform to break tie, and merge in + matchesA$uni <- runif(nrow(matchesA)) + temp <- as.matrix(tapply(matchesA$uni, matchesA$idA, max, na.rm = T)) + temp <- data.frame(cbind(as.numeric(rownames(temp)), as.numeric(temp))) + names(temp) <- c("idA", "uni.max") + matchesA <- merge(matchesA, temp, by = "idA") + matchesA <- matchesA[order(matchesA$roworder), ] + matchesB <- matchesB[order(matchesB$roworder), ] + matchesA$rm <- abs(matchesA$uni - matchesA$uni.max) + rm <- which(matchesA$rm == 0) + + ## Subset down to broken tie + matchesA <- matchesA[rm, ] + matchesB <- matchesB[rm, ] + + }else{ + + ## Find duplicates + dupA <- duplicated(matchesA$idA) + dupB <- duplicated(matchesA$idA, fromLast = T) + matchesA$dupA <- ifelse(dupA == 1 | dupB == 1, 1, 0) + + dupA <- duplicated(matchesB$idB) + dupB <- duplicated(matchesB$idB, fromLast = T) + matchesA$dupB <- ifelse(dupA == 1 | dupB == 1, 1, 0) + + ## Split into dupes, not dups + dups <- subset(matchesA, dupA == 1 | dupB == 1) + nodups <- subset(matchesA, dupA == 0 & dupB == 0) + + dups$idA.t <- as.numeric(as.factor(dups$idA)) + dups$idB.t <- as.numeric(as.factor(dups$idB)) + + nr <- max(dups$idA.t) + nc <- max(dups$idB.t) + dim <- max(nr, nc) + + ## Create adjacency matrix to id duplicates + mat.adj <- sparseMatrix(i = dups$idA.t, j = dups$idB.t, x = dups$zeta.j, + dims = c(dim, dim)) + mat.adj <- as.matrix(mat.adj) + + ## Solve linear sum assignment problem + T1 <- suppressWarnings(assignment(-mat.adj)) + temp.0 <- cbind(1:dim, T1$perm) + n1 <- which(rowSums(mat.adj) == 0) + n2 <- which(colSums(mat.adj) == 0) + + if(length(n1) > 0) { + temp.0 <- temp.0[-n1, ] + } - ## Merge in dedupe information - dedup <- merge(temp.0, dups, by = c("idA.t", "idB.t")) - dedup$idA.t <- dedup$idB.t <- NULL + if(length(n2) > 0) { + temp.0 <- temp.0[, -n2] + } - ## Combine dupes, dedupes - matchesA <- rbind(dedup, nodups) - matchesA$dupA <- matchesA$dupB <- NULL - listA <- paste(matchesA$idA, matchesA$idB, sep = "-") - listB <- paste(matchesB$idA, matchesB$idB, sep = "-") - keep <- which(listB %in% listA) - matchesB <- matchesB[keep, ] + temp.0 <- data.frame(temp.0) + names(temp.0) <- c("idA.t", "idB.t") - ## Subset down and order - matchesA <- matchesA[order(matchesA$idA, matchesA$idB), ] - matchesB <- matchesB[order(matchesB$idA, matchesB$idB), ] + ## Merge in dedupe information + dedup <- merge(temp.0, dups, by = c("idA.t", "idB.t")) + dedup$idA.t <- dedup$idB.t <- NULL - } + ## Combine dupes, dedupes + matchesA <- rbind(dedup, nodups) + matchesA$dupA <- matchesA$dupB <- NULL + listA <- paste(matchesA$idA, matchesA$idB, sep = "-") + listB <- paste(matchesB$idA, matchesB$idB, sep = "-") + keep <- which(listB %in% listA) + matchesB <- matchesB[keep, ] - ## ----------------- - ## Correct EM object - ## ----------------- - counts <- eval(parse( - text = paste0("data.frame(matchesA %>% group_by(", - paste(namevec, collapse = ", "), - ") %>% summarise(counts = n()))")) - ) - patterns <- as.data.frame(EM$patterns.w) - patterns$rownum <- 1:nrow(patterns) - patterns <- merge(patterns, counts, by = namevec, all.x = TRUE) - patterns$counts.x <- ifelse(!is.na(patterns$counts.y), patterns$counts.y, - patterns$counts.x) - patterns <- patterns[order(patterns$rownum),] - patterns$counts.y <- NULL; patterns$rownum <- NULL - names(patterns) <- c(namevec, "counts", "weights", "p.gamma.j.m", "p.gamma.j.u") - EM$patterns.w <- as.matrix(patterns) - - ## -------------------------- - ## Correct matchesLink object - ## -------------------------- - matchesLink <- data.frame(inds.a = matchesA$idA, inds.b = matchesB$idB) - - ## -------------------------- - ## Correct dataframes objects - ## -------------------------- - matchesA <- subset(matchesA, select = colnames.df.a) - matchesB <- subset(matchesB, select = colnames.df.b) - - ## Return deduped object - out <- list(matchesA = matchesA, matchesB = matchesB, - EM = EM, matchesLink = matchesLink) - return(out) + ## Subset down and order + matchesA <- matchesA[order(matchesA$idA, matchesA$idB), ] + matchesB <- matchesB[order(matchesB$idA, matchesB$idB), ] } + ## ----------------- + ## Correct EM object + ## ----------------- + counts <- eval(parse( + text = paste0("data.frame(matchesA %>% group_by(", + paste(namevec, collapse = ", "), + ") %>% summarise(counts = n()))")) + ) + patterns <- as.data.frame(EM$patterns.w) + patterns$rownum <- 1:nrow(patterns) + patterns <- merge(patterns, counts, by = namevec, all.x = TRUE) + patterns$counts.x <- ifelse(!is.na(patterns$counts.y), patterns$counts.y, + patterns$counts.x) + patterns <- patterns[order(patterns$rownum),] + patterns$counts.y <- NULL; patterns$rownum <- NULL + names(patterns) <- c(namevec, "counts", "weights", "p.gamma.j.m", "p.gamma.j.u") + EM$patterns.w <- as.matrix(patterns) + + ## -------------------------- + ## Correct matchesLink object + ## -------------------------- + matchesLink <- data.frame(inds.a = matchesA$idA, inds.b = matchesB$idB) + + ## ------------------- + ## Get the zeta values + ## ------------------- + max.zeta <- matchesA$zeta.j + + ## -------------------------- + ## Correct dataframes objects + ## -------------------------- + matchesA <- subset(matchesA, select = colnames.df.a) + matchesB <- subset(matchesB, select = colnames.df.b) + + ## Return deduped object + out <- list(matchesA = matchesA, matchesB = matchesB, + EM = EM, matchesLink = matchesLink, + max.zeta = max.zeta) + return(out) + +} + diff --git a/R/fastLink.R b/R/fastLink.R index 46a4b8a..a98d9ab 100644 --- a/R/fastLink.R +++ b/R/fastLink.R @@ -326,6 +326,9 @@ fastLink <- function(dfA, dfB, varnames, out[["EM"]] <- resultsEM out[["nobs.a"]] <- nr_a out[["nobs.b"]] <- nr_b + if(dedupe.matches){ + out[["max.zeta"]] <- ddm.out$max.zeta + } if(reweight.names){ out[["zeta.name"]] <- rwn.out } diff --git a/R/getMatches.R b/R/getMatches.R index 926a293..8621f89 100644 --- a/R/getMatches.R +++ b/R/getMatches.R @@ -29,6 +29,10 @@ getMatches <- function(dfA, dfB, fl.out){ }else{ dfA.match <- dfA[fl.out$matches$inds.a,] dfB.match <- dfB[fl.out$matches$inds.b,] + if("max.zeta" %in% names(fl.out)){ + dfA.match$max.zeta <- fl.out$max.zeta + dfB.match$max.zeta <- fl.out$max.zeta + } } return(list(dfA.match = dfA.match, dfB.match = dfB.match)) diff --git a/README.Rmd b/README.Rmd index cfd424f..4f35242 100644 --- a/README.Rmd +++ b/README.Rmd @@ -320,6 +320,8 @@ which returns a list with the following elements: - `matchesLink`: Deduped indices of the matched pairs from dataset A and dataset B. +- `max.zeta`: The posterior matching probability for each matched pair. + Other arguments to `dedupeMatches()` include: - `linprog`: Whether to use Winkler's linear assignment solution to the deduping problem. Recommended, but can be slow on larger data sets. If set to `FALSE`, then the deduping is conducted by iteratively selecting the matched pair for a given observation with the largest posterior match probability. Default is `TRUE`. diff --git a/README.md b/README.md index c99a5ef..f2330d7 100644 --- a/README.md +++ b/README.md @@ -127,358 +127,393 @@ matches.out$EM ## $zeta.j ## [,1] - ## [1,] 6.726338516239716e-169 - ## [2,] 1.968013532180496e-166 - ## [3,] 1.680295763347649e-140 - ## [4,] 1.238692768975625e-144 - ## [5,] 3.094358404314386e-116 - ## [6,] 8.296669584565404e-147 - ## [7,] 2.427465994319746e-144 - ## [8,] 2.072577631824755e-118 - ## [9,] 9.953565033282524e-160 - ## [10,] 1.227732444185553e-137 - ## [11,] 7.182658094458477e-137 - ## [12,] 1.322726565448536e-112 - ## [13,] 8.859521536828695e-115 - ## [14,] 4.869812970619062e-143 - ## [15,] 6.006719563445632e-121 - ## [16,] 1.500528914759000e-92 - ## [17,] 9.976796525768816e-125 - ## [18,] 2.492287430012088e-96 - ## [19,] 4.499703606489751e-165 - ## [20,] 1.316537603183890e-162 - ## [21,] 1.124063692014666e-136 - ## [22,] 5.550204462857007e-143 - ## [23,] 8.364129461482081e-143 - ## [24,] 1.540301109987223e-118 - ## [25,] 1.031681922295519e-120 - ## [26,] 6.696328002233358e-146 - ## [27,] 1.959232960472893e-143 - ## [28,] 1.672798885303372e-117 - ## [29,] 1.233166165370534e-121 - ## [30,] 8.259652815609666e-124 - ## [31,] 2.416635510239041e-121 - ## [32,] 2.063330532545025e-95 - ## [33,] 9.909155790107605e-137 - ## [34,] 1.222254741625188e-114 - ## [35,] 7.150611645885274e-114 - ## [36,] 8.819993523998181e-92 - ## [37,] 4.848085608844114e-120 - ## [38,] 9.932283631992761e-102 - ## [39,] 4.479627540175326e-142 - ## [40,] 5.525441437867042e-120 - ## [41,] 8.326811710710902e-120 - ## [42,] 1.027078926965384e-97 - ## [43,] 8.897034385463424e-145 - ## [44,] 2.603122638652995e-142 - ## [45,] 2.222553793294658e-116 - ## [46,] 1.638438525208423e-120 - ## [47,] 1.097413613669459e-122 - ## [48,] 2.741431227757439e-94 - ## [49,] 9.500615511862354e-113 - ## [50,] 7.945183010159628e-97 - ## [51,] 1.319646662626744e-100 - ## [52,] 1.106336638330167e-118 - ## [53,] 8.857339003734515e-122 - ## [54,] 2.212637554083307e-93 - ## [55,] 1.631128399173195e-97 - ## [56,] 1.092517347068471e-99 - ## [57,] 1.000000000000000e+00 - ## [58,] 9.999999999999627e-01 + ## [1,] 2.265689914190897e-133 + ## [2,] 6.886298384652935e-131 + ## [3,] 2.242176255533292e-112 + ## [4,] 1.084486250224272e-113 + ## [5,] 3.296168582612452e-111 + ## [6,] 1.073231294571635e-92 + ## [7,] 7.622399055812778e-116 + ## [8,] 2.316738666507610e-113 + ## [9,] 7.543292692479568e-95 + ## [10,] 1.229796296191092e-128 + ## [11,] 4.137370285410978e-111 + ## [12,] 8.312817987620266e-110 + ## [13,] 2.526583391730493e-107 + ## [14,] 3.978980862176186e-90 + ## [15,] 2.796658782965287e-92 + ## [16,] 3.954539858576797e-112 + ## [17,] 1.330415106471150e-94 + ## [18,] 1.316607865466632e-73 + ## [19,] 2.209738722088584e-98 + ## [20,] 2.186805733020369e-77 + ## [21,] 6.955576537835112e-127 + ## [22,] 6.883390555342783e-106 + ## [23,] 2.340045727464861e-109 + ## [24,] 3.775424964610830e-122 + ## [25,] 6.783808637641159e-92 + ## [26,] 2.446009778586403e-109 + ## [27,] 2.420624734213282e-88 + ## [28,] 1.170797449455165e-89 + ## [29,] 8.229044279196036e-92 + ## [30,] 7.012998282482714e-115 + ## [31,] 2.131518458980329e-112 + ## [32,] 6.940216368792931e-94 + ## [33,] 3.356814258898590e-95 + ## [34,] 3.321976753480488e-74 + ## [35,] 2.359363969093694e-97 + ## [36,] 7.171009672336122e-95 + ## [37,] 2.334878147502974e-76 + ## [38,] 3.806592975928665e-110 + ## [39,] 1.280641738476516e-92 + ## [40,] 2.573069593708699e-91 + ## [41,] 8.656508165031972e-74 + ## [42,] 1.224050169553390e-93 + ## [43,] 6.839812352819897e-80 + ## [44,] 2.152962151086461e-108 + ## [45,] 7.243152103407796e-91 + ## [46,] 7.571143018609953e-91 + ## [47,] 2.547139087083917e-73 + ## [48,] 5.574773507151971e-114 + ## [49,] 1.694386930738263e-111 + ## [50,] 5.516917698852402e-93 + ## [51,] 2.668399227429084e-94 + ## [52,] 1.875505913281997e-96 + ## [53,] 5.700379941732806e-94 + ## [54,] 1.856041640797322e-75 + ## [55,] 2.045384816205463e-90 + ## [56,] 3.273511897023536e-75 + ## [57,] 5.437104525411842e-79 + ## [58,] 6.018453993412995e-90 + ## [59,] 1.725561683706721e-95 + ## [60,] 1.707653554191946e-74 + ## [61,] 8.259505893427005e-76 + ## [62,] 5.805260316626118e-78 + ## [63,] 5.297404683051640e-89 + ## [64,] 9.999999999999982e-01 + ## [65,] 9.999999999997478e-01 ## ## $p.m - ## [1] 0.0002857142857142842 + ## [1] 0.0002857142857142751 ## ## $p.u - ## [1] 0.9997142857142857 + ## [1] 0.9997142857142858 ## ## $p.gamma.k.m ## $p.gamma.k.m[[1]] - ## [1] 1.449981306143429e-122 5.292032030289467e-93 1.000000000000000e+00 + ## [1] 2.287437535920482e-95 3.588534287818767e-74 1.000000000000000e+00 ## ## $p.gamma.k.m[[2]] - ## [1] 1.543700619127885e-94 1.000000000000000e+00 + ## [1] 1.191386200599044e-75 1.000000000000000e+00 ## ## $p.gamma.k.m[[3]] - ## [1] 2.444509483250389e-116 4.910509392409854e-94 1.000000000000000e+00 + ## [1] 2.561283476953127e-94 3.555589628039962e-74 1.000000000000000e+00 ## ## $p.gamma.k.m[[4]] - ## [1] 5.482725985436894e-93 1.000000000000000e+00 + ## [1] 3.804930578408218e-74 1.000000000000000e+00 ## ## $p.gamma.k.m[[5]] - ## [1] 3.315264862720235e-121 5.783038837008493e-93 1.000000000000000e+00 + ## [1] 1.147755523578792e-90 1.018413213441087e-74 1.000000000000000e+00 ## ## $p.gamma.k.m[[6]] - ## [1] 3.277353765076771e-94 1.000000000000000e+00 + ## [1] 2.886072200167151e-75 1.000000000000000e+00 ## ## $p.gamma.k.m[[7]] - ## [1] 5.622846792831123e-93 1.000000000000000e+00 + ## [1] 3.941386330791326e-74 1.000000000000000e+00 ## ## ## $p.gamma.k.u ## $p.gamma.k.u[[1]] - ## [1] 0.987384967133466684 0.011494712775078596 0.001120320091454701 + ## [1] 0.986041726207487867 0.012403543869677061 0.001554729922835096 ## ## $p.gamma.k.u[[2]] - ## [1] 0.993302076356329500 0.006697923643670462 + ## [1] 0.992971419366325603 0.007028580633674448 ## ## $p.gamma.k.u[[3]] - ## [1] 0.9992397827950842970 0.0006516147470705930 0.0001086024578450986 + ## [1] 0.9990225778793940803 0.0006916261789082700 0.0002857959416976279 ## ## $p.gamma.k.u[[4]] - ## [1] 0.9998339060710195181 0.0001660939289805284 + ## [1] 0.9998339060710195181 0.0001660939289805375 ## ## $p.gamma.k.u[[5]] - ## [1] 0.9991597599314089306 0.0004515575878822535 0.0003886824807087740 + ## [1] 0.9984452700771648814 0.0008516719062589311 0.0007030580165761752 ## ## $p.gamma.k.u[[6]] - ## [1] 0.8836924835667334 0.1163075164332666 + ## [1] 0.8836924835667334 0.1163075164332667 ## ## $p.gamma.k.u[[7]] - ## [1] 0.98807659331237496 0.01192340668762504 + ## [1] 0.98807659331237496 0.01192340668762505 ## ## ## $p.gamma.j.m ## [,1] - ## [1,] 1.005969480687389e-165 - ## [2,] 3.426460883210723e-165 - ## [3,] 2.851329655545498e-140 - ## [4,] 1.249190107317839e-143 - ## [5,] 3.540716559289022e-118 - ## [6,] 1.249190107317839e-143 - ## [7,] 4.254901486169948e-143 - ## [8,] 3.540716559289022e-118 - ## [9,] 9.707467192993665e-160 - ## [10,] 1.205451280322474e-137 - ## [11,] 1.167511633223870e-137 - ## [12,] 1.449789492028309e-115 - ## [13,] 1.449789492028309e-115 - ## [14,] 1.209885481376701e-143 - ## [15,] 1.502408376534875e-121 - ## [16,] 4.258440878173093e-96 - ## [17,] 1.502408376534875e-121 - ## [18,] 4.258440878173093e-96 - ## [19,] 3.041362609098279e-165 - ## [20,] 1.035927054627354e-164 - ## [21,] 8.620467685225447e-140 - ## [22,] 3.776695175141565e-143 - ## [23,] 4.866165351925672e-143 - ## [24,] 6.042693873818818e-121 - ## [25,] 6.042693873818818e-121 - ## [26,] 1.318103230272816e-143 - ## [27,] 4.489628408485496e-143 - ## [28,] 3.736044583558422e-118 - ## [29,] 1.636790725057959e-121 - ## [30,] 1.636790725057959e-121 - ## [31,] 5.575118829232217e-121 - ## [32,] 4.639335510546786e-96 - ## [33,] 1.271951496591038e-137 - ## [34,] 1.579480547902744e-115 - ## [35,] 1.529768929055311e-115 - ## [36,] 1.899632393770296e-93 - ## [37,] 1.585290599644335e-121 - ## [38,] 1.968577946267692e-99 - ## [39,] 3.985041252687040e-143 - ## [40,] 4.948533932369688e-121 - ## [41,] 6.376046582478887e-121 - ## [42,] 7.917630174215252e-99 - ## [43,] 1.605687771500473e-143 - ## [44,] 5.469178186138129e-143 - ## [45,] 4.551176997236172e-118 - ## [46,] 1.993906692108620e-121 - ## [47,] 1.993906692108620e-121 - ## [48,] 5.651548472141323e-96 - ## [49,] 1.863534817449074e-115 - ## [50,] 2.398083445189123e-99 - ## [51,] 2.398083445189123e-99 - ## [52,] 7.767176191416143e-121 - ## [53,] 2.103903029919092e-121 - ## [54,] 5.963323159168848e-96 - ## [55,] 2.612579111182405e-99 - ## [56,] 2.612579111182405e-99 - ## [57,] 5.000000000000000e-01 - ## [58,] 5.000000000000000e-01 + ## [1,] 3.379602789911592e-130 + ## [2,] 1.292116044135405e-129 + ## [3,] 5.273447194639989e-112 + ## [4,] 1.145038585671160e-112 + ## [5,] 4.377800646029406e-112 + ## [6,] 1.786689410775372e-94 + ## [7,] 1.145038585671160e-112 + ## [8,] 4.377800646029406e-112 + ## [9,] 1.786689410775372e-94 + ## [10,] 1.269973004681962e-128 + ## [11,] 4.302778117778702e-111 + ## [12,] 3.547269740850954e-110 + ## [13,] 1.356219777871981e-109 + ## [14,] 1.201845595341200e-92 + ## [15,] 1.201845595341200e-92 + ## [16,] 9.799119276589166e-113 + ## [17,] 3.320026161293994e-95 + ## [18,] 5.180485321727610e-77 + ## [19,] 3.320026161293994e-95 + ## [20,] 5.180485321727610e-77 + ## [21,] 8.850063363117643e-127 + ## [22,] 1.380941628819001e-108 + ## [23,] 2.998477829008260e-109 + ## [24,] 3.325639804309154e-125 + ## [25,] 8.694051852001183e-92 + ## [26,] 2.569154832193061e-109 + ## [27,] 4.008844584596373e-91 + ## [28,] 8.704518247546595e-92 + ## [29,] 8.704518247546595e-92 + ## [30,] 1.376814852165920e-112 + ## [31,] 5.263945708643433e-112 + ## [32,] 2.148347267722183e-94 + ## [33,] 4.664767515759897e-95 + ## [34,] 7.278785910303555e-77 + ## [35,] 4.664767515759897e-95 + ## [36,] 1.783470225337442e-94 + ## [37,] 7.278785910303555e-77 + ## [38,] 5.173737280355348e-111 + ## [39,] 1.752906831482172e-93 + ## [40,] 1.445120615482184e-92 + ## [41,] 4.896193335546380e-75 + ## [42,] 3.992058770464637e-95 + ## [43,] 1.352543956376726e-77 + ## [44,] 3.605423311083427e-109 + ## [45,] 1.221548526706203e-91 + ## [46,] 1.046646825193821e-91 + ## [47,] 3.546129752273321e-74 + ## [48,] 1.003464844528235e-112 + ## [49,] 3.836524899349538e-112 + ## [50,] 1.565781305747932e-94 + ## [51,] 3.399825475879069e-95 + ## [52,] 3.399825475879069e-95 + ## [53,] 1.299847738839836e-94 + ## [54,] 5.305002165212598e-77 + ## [55,] 1.053248177456893e-92 + ## [56,] 9.857754721109126e-78 + ## [57,] 9.857754721109126e-78 + ## [58,] 7.628282714025517e-92 + ## [59,] 4.088010891981130e-95 + ## [60,] 6.378829380283159e-77 + ## [61,] 1.385053363056516e-77 + ## [62,] 1.385053363056516e-77 + ## [63,] 1.070515018248445e-91 + ## [64,] 5.000000000000000e-01 + ## [65,] 5.000000000000000e-01 ## ## $p.gamma.j.u ## [,1] - ## [1,] 2.863757478838720e-01 - ## [2,] 3.333863768687974e-03 - ## [3,] 3.249315259387583e-04 - ## [4,] 1.931056964827189e-03 - ## [5,] 2.191041982055012e-06 - ## [6,] 2.883068048486992e-01 - ## [7,] 3.356344306575284e-03 - ## [8,] 3.271225679208135e-04 - ## [9,] 1.867486300460568e-04 - ## [10,] 1.880078925547961e-04 - ## [11,] 3.112477167434274e-05 - ## [12,] 2.098770847899037e-07 - ## [13,] 3.133464875913262e-05 - ## [14,] 4.757317474627726e-05 - ## [15,] 4.789396486594202e-05 - ## [16,] 5.434209845680946e-08 - ## [17,] 2.883546988135652e-01 - ## [18,] 3.271769100192702e-04 - ## [19,] 1.294238890798554e-04 - ## [20,] 1.506697469301733e-06 - ## [21,] 1.468486842283143e-07 - ## [22,] 1.302966057965099e-04 - ## [23,] 1.114028412332929e-04 - ## [24,] 7.511991991456039e-07 - ## [25,] 1.121540404324386e-04 - ## [26,] 3.769145106752195e-02 - ## [27,] 4.387877256779533e-04 - ## [28,] 4.276598420332113e-05 - ## [29,] 2.541567840021710e-04 - ## [30,] 3.794560785152411e-02 - ## [31,] 4.417465100722750e-04 - ## [32,] 4.305435901251417e-05 - ## [33,] 2.457899072571613e-05 - ## [34,] 2.474472903135143e-05 - ## [35,] 4.096498454286010e-06 - ## [36,] 4.124121505225226e-06 - ## [37,] 6.261361170859698e-06 - ## [38,] 3.795191143360645e-02 - ## [39,] 1.703417352296152e-05 - ## [40,] 1.714903645973134e-05 - ## [41,] 1.466232657672632e-05 - ## [42,] 1.476119594002186e-05 - ## [43,] 3.455779167934082e-03 - ## [44,] 4.023070055930163e-05 - ## [45,] 3.921042918758394e-06 - ## [46,] 2.330262419375648e-05 - ## [47,] 3.479081792127839e-03 - ## [48,] 3.947482857522776e-06 - ## [49,] 3.755916426362859e-07 - ## [50,] 5.779503581448713e-07 - ## [51,] 3.479659742485983e-03 - ## [52,] 1.344330380025045e-06 - ## [53,] 4.548336665057549e-04 - ## [54,] 5.160695289252128e-07 - ## [55,] 3.066983590733346e-06 - ## [56,] 4.579006500964880e-04 - ## [57,] 2.444122297210018e-20 - ## [58,] 3.649074589734563e-18 + ## [1,] 2.857213509222646e-01 + ## [2,] 3.594125092756943e-03 + ## [3,] 4.505078457280588e-04 + ## [4,] 2.022430368641518e-03 + ## [5,] 2.544040798080149e-05 + ## [6,] 3.188843765335484e-06 + ## [7,] 2.877437812909061e-01 + ## [8,] 3.619565500737745e-03 + ## [9,] 4.536966894933943e-04 + ## [10,] 1.978057058433490e-04 + ## [11,] 1.992058401535673e-04 + ## [12,] 8.173789497658884e-05 + ## [13,] 1.028191342425847e-06 + ## [14,] 5.785678967843724e-07 + ## [15,] 8.231646287337325e-05 + ## [16,] 4.746446532784001e-05 + ## [17,] 4.780043453630311e-05 + ## [18,] 7.536878402088282e-08 + ## [19,] 2.877915817254423e-01 + ## [20,] 4.537720582774151e-04 + ## [21,] 2.437197660118470e-04 + ## [22,] 3.842823309946346e-07 + ## [23,] 2.454448952492300e-04 + ## [24,] 1.687278888621291e-07 + ## [25,] 2.454856689284907e-04 + ## [26,] 2.011914846943475e-04 + ## [27,] 3.172263537741010e-07 + ## [28,] 1.424099974483975e-06 + ## [29,] 2.026155846688315e-04 + ## [30,] 3.760532236689203e-02 + ## [31,] 4.730421170969218e-04 + ## [32,] 5.929375845638836e-05 + ## [33,] 2.661829286886174e-04 + ## [34,] 4.197008637472115e-07 + ## [35,] 3.787150529558064e-02 + ## [36,] 4.763904658996110e-04 + ## [37,] 5.971345932013548e-05 + ## [38,] 2.603427188846501e-05 + ## [39,] 2.621855108889141e-05 + ## [40,] 1.075796359027457e-05 + ## [41,] 1.083411202020283e-05 + ## [42,] 6.247053340130711e-06 + ## [43,] 3.787779656763368e-02 + ## [44,] 3.207726807421036e-05 + ## [45,] 3.230432160341607e-05 + ## [46,] 2.647989243710033e-05 + ## [47,] 2.666732588738429e-05 + ## [48,] 3.447882370093512e-03 + ## [49,] 4.337134940468225e-05 + ## [50,] 5.436408773305789e-06 + ## [51,] 2.440525354606058e-05 + ## [52,] 3.472287623639570e-03 + ## [53,] 4.367834618277343e-05 + ## [54,] 5.474889475444408e-06 + ## [55,] 9.863548738960371e-07 + ## [56,] 5.768217005433660e-07 + ## [57,] 3.472864445340112e-03 + ## [58,] 2.427835969735803e-06 + ## [59,] 4.537943265071782e-04 + ## [60,] 7.155149721169606e-07 + ## [61,] 3.212106564955436e-06 + ## [62,] 4.570064330721336e-04 + ## [63,] 3.870856928151778e-07 + ## [64,] 1.694818367219328e-19 + ## [65,] 2.411323787194438e-17 ## ## $patterns.w ## gamma.1 gamma.2 gamma.3 gamma.4 gamma.5 gamma.6 gamma.7 counts - ## 1 0 0 0 0 0 0 0 101069 - ## 40 1 0 0 0 0 0 0 133 - ## 46 2 0 0 0 0 0 0 1181 - ## 17 0 2 0 0 0 0 0 691 - ## 51 2 2 0 0 0 0 0 9 - ## 23 0 NA 0 0 0 0 0 48474 - ## 44 1 NA 0 0 0 0 0 48 - ## 53 2 NA 0 0 0 0 0 559 - ## 12 0 0 1 0 0 0 0 12 - ## 36 0 NA 1 0 0 0 0 3 - ## 14 0 0 2 0 0 0 0 65 - ## 22 0 2 2 0 0 0 0 1 - ## 38 0 NA 2 0 0 0 0 36 - ## 10 0 0 0 2 0 0 0 15 - ## 31 0 NA 0 2 0 0 0 8 - ## 56 2 NA 0 2 0 0 0 1 - ## 33 0 NA 0 NA 0 0 0 323 - ## 57 2 NA 0 NA 0 0 0 4 - ## 5 0 0 0 0 1 0 0 40 - ## 43 1 0 0 0 1 0 0 1 - ## 50 2 0 0 0 1 0 0 3 - ## 27 0 NA 0 0 1 0 0 17 - ## 7 0 0 0 0 2 0 0 43 - ## 21 0 2 0 0 2 0 0 1 - ## 29 0 NA 0 0 2 0 0 27 - ## 3 0 0 0 0 0 2 0 13032 - ## 42 1 0 0 0 0 2 0 9 - ## 48 2 0 0 0 0 2 0 153 - ## 19 0 2 0 0 0 2 0 75 - ## 25 0 NA 0 0 0 2 0 6701 - ## 45 1 NA 0 0 0 2 0 3 - ## 55 2 NA 0 0 0 2 0 74 - ## 13 0 0 1 0 0 2 0 3 - ## 37 0 NA 1 0 0 2 0 1 - ## 16 0 0 2 0 0 2 0 8 - ## 39 0 NA 2 0 0 2 0 3 - ## 11 0 0 0 2 0 2 0 4 - ## 35 0 NA 0 NA 0 2 0 20 - ## 6 0 0 0 0 1 2 0 4 - ## 28 0 NA 0 0 1 2 0 3 - ## 9 0 0 0 0 2 2 0 3 - ## 30 0 NA 0 0 2 2 0 4 - ## 2 0 0 0 0 0 0 2 1203 - ## 41 1 0 0 0 0 0 2 2 - ## 47 2 0 0 0 0 0 2 19 - ## 18 0 2 0 0 0 0 2 10 - ## 24 0 NA 0 0 0 0 2 593 - ## 54 2 NA 0 0 0 0 2 5 - ## 15 0 0 2 0 0 0 2 1 - ## 32 0 NA 0 2 0 0 2 1 - ## 34 0 NA 0 NA 0 0 2 3 - ## 8 0 0 0 0 2 0 2 1 - ## 4 0 0 0 0 0 2 2 150 - ## 49 2 0 0 0 0 2 2 3 - ## 20 0 2 0 0 0 2 2 3 - ## 26 0 NA 0 0 0 2 2 92 - ## 52 2 2 2 2 2 2 2 43 - ## 58 2 NA 2 2 2 2 2 7 + ## 1 0 0 0 0 0 0 0 100795 + ## 43 1 0 0 0 0 0 0 164 + ## 51 2 0 0 0 0 0 0 1289 + ## 19 0 2 0 0 0 0 0 722 + ## 47 1 2 0 0 0 0 0 2 + ## 57 2 2 0 0 0 0 0 9 + ## 25 0 NA 0 0 0 0 0 48376 + ## 48 1 NA 0 0 0 0 0 67 + ## 60 2 NA 0 0 0 0 0 597 + ## 13 0 0 1 0 0 0 0 32 + ## 39 0 NA 1 0 0 0 0 10 + ## 16 0 0 2 0 0 0 0 69 + ## 46 1 0 2 0 0 0 0 1 + ## 24 0 2 2 0 0 0 0 1 + ## 41 0 NA 2 0 0 0 0 37 + ## 11 0 0 0 2 0 0 0 15 + ## 33 0 NA 0 2 0 0 0 8 + ## 63 2 NA 0 2 0 0 0 1 + ## 35 0 NA 0 NA 0 0 0 322 + ## 64 2 NA 0 NA 0 0 0 4 + ## 5 0 0 0 0 1 0 0 89 + ## 55 2 0 0 0 1 0 0 4 + ## 29 0 NA 0 0 1 0 0 36 + ## 15 0 0 1 0 1 0 0 1 + ## 38 0 NA 0 NA 1 0 0 1 + ## 8 0 0 0 0 2 0 0 68 + ## 56 2 0 0 0 2 0 0 2 + ## 23 0 2 0 0 2 0 0 1 + ## 31 0 NA 0 0 2 0 0 41 + ## 3 0 0 0 0 0 2 0 12994 + ## 45 1 0 0 0 0 2 0 23 + ## 53 2 0 0 0 0 2 0 160 + ## 21 0 2 0 0 0 2 0 79 + ## 58 2 2 0 0 0 2 0 1 + ## 27 0 NA 0 0 0 2 0 6689 + ## 50 1 NA 0 0 0 2 0 8 + ## 62 2 NA 0 0 0 2 0 76 + ## 14 0 0 1 0 0 2 0 6 + ## 40 0 NA 1 0 0 2 0 1 + ## 18 0 0 2 0 0 2 0 9 + ## 42 0 NA 2 0 0 2 0 3 + ## 12 0 0 0 2 0 2 0 4 + ## 37 0 NA 0 NA 0 2 0 20 + ## 6 0 0 0 0 1 2 0 11 + ## 30 0 NA 0 0 1 2 0 6 + ## 10 0 0 0 0 2 2 0 4 + ## 32 0 NA 0 0 2 2 0 6 + ## 2 0 0 0 0 0 0 2 1198 + ## 44 1 0 0 0 0 0 2 6 + ## 52 2 0 0 0 0 0 2 19 + ## 20 0 2 0 0 0 0 2 11 + ## 26 0 NA 0 0 0 0 2 592 + ## 49 1 NA 0 0 0 0 2 1 + ## 61 2 NA 0 0 0 0 2 5 + ## 17 0 0 2 0 0 0 2 1 + ## 34 0 NA 0 2 0 0 2 1 + ## 36 0 NA 0 NA 0 0 2 3 + ## 9 0 0 0 0 2 0 2 1 + ## 4 0 0 0 0 0 2 2 149 + ## 54 2 0 0 0 0 2 2 3 + ## 22 0 2 0 0 0 2 2 3 + ## 28 0 NA 0 0 0 2 2 92 + ## 7 0 0 0 0 1 2 2 1 + ## 59 2 2 2 2 2 2 2 43 + ## 65 2 NA 2 2 2 2 2 7 ## weights p.gamma.j.m p.gamma.j.u - ## 1 -378.67013808343148 1.005969480687389e-165 2.863757478838720e-01 - ## 40 -372.99138907128992 3.426460883210723e-165 3.333863768687974e-03 - ## 46 -313.28223150062718 2.851329655545498e-140 3.249315259387583e-04 - ## 17 -322.79748509516571 1.249190107317839e-143 1.931056964827189e-03 - ## 51 -257.40957851236141 3.540716559289022e-118 2.191041982055012e-06 - ## 23 -327.80344279971081 1.249190107317839e-143 2.883068048486992e-01 - ## 44 -322.12469378756924 4.254901486169948e-143 3.356344306575284e-03 - ## 53 -262.41553621690656 3.540716559289022e-118 3.271225679208135e-04 - ## 12 -357.55497240623953 9.707467192993665e-160 1.867486300460568e-04 - ## 36 -306.68827712251891 1.205451280322474e-137 1.880078925547961e-04 - ## 14 -304.92177652648513 1.167511633223870e-137 3.112477167434274e-05 - ## 22 -249.04912353821933 1.449789492028309e-115 2.098770847899037e-07 - ## 38 -254.05508124276449 1.449789492028309e-115 3.133464875913262e-05 - ## 10 -319.12590107517457 1.209885481376701e-143 4.757317474627726e-05 - ## 31 -268.25920579145395 1.502408376534875e-121 4.789396486594202e-05 - ## 56 -202.87129920864970 4.258440878173093e-96 5.434209845680946e-08 - ## 33 -276.96216288385511 1.502408376534875e-121 2.883546988135652e-01 - ## 57 -211.57425630105084 4.258440878173093e-96 3.271769100192702e-04 - ## 5 -369.86181712362770 3.041362609098279e-165 1.294238890798554e-04 - ## 43 -364.18306811148608 1.035927054627354e-164 1.506697469301733e-06 - ## 50 -304.47391054082345 8.620467685225447e-140 1.468486842283143e-07 - ## 27 -318.99512183990709 3.776695175141565e-143 1.302966057965099e-04 - ## 7 -318.58500434727739 4.866165351925672e-143 1.114028412332929e-04 - ## 21 -262.71235135901156 6.042693873818818e-121 7.511991991456039e-07 - ## 29 -267.71830906355672 6.042693873818818e-121 1.121540404324386e-04 - ## 3 -325.71515256933407 1.318103230272816e-143 3.769145106752195e-02 - ## 42 -320.03640355719244 4.489628408485496e-143 4.387877256779533e-04 - ## 48 -260.32724598652976 3.736044583558422e-118 4.276598420332113e-05 - ## 19 -269.84249958106824 1.636790725057959e-121 2.541567840021710e-04 - ## 25 -274.84845728561339 1.636790725057959e-121 3.794560785152411e-02 - ## 45 -269.16970827347177 5.575118829232217e-121 4.417465100722750e-04 - ## 55 -209.46055070280914 4.639335510546786e-96 4.305435901251417e-05 - ## 13 -304.59998689214211 1.271951496591038e-137 2.457899072571613e-05 - ## 37 -253.73329160842150 1.579480547902744e-115 2.474472903135143e-05 - ## 16 -251.96679101238772 1.529768929055311e-115 4.096498454286010e-06 - ## 39 -201.10009572866707 1.899632393770296e-93 4.124121505225226e-06 - ## 11 -266.17091556107715 1.585290599644335e-121 6.261361170859698e-06 - ## 35 -224.00717736975770 1.968577946267692e-99 3.795191143360645e-02 - ## 6 -316.90683160953023 3.985041252687040e-143 1.703417352296152e-05 - ## 28 -266.04013632580967 4.948533932369688e-121 1.714903645973134e-05 - ## 9 -265.63001883317992 6.376046582478887e-121 1.466232657672632e-05 - ## 30 -214.76332354945930 7.917630174215252e-99 1.476119594002186e-05 - ## 2 -323.12840878703622 1.605687771500473e-143 3.455779167934082e-03 - ## 41 -317.44965977489466 5.469178186138129e-143 4.023070055930163e-05 - ## 47 -257.74050220423192 4.551176997236172e-118 3.921042918758394e-06 - ## 18 -267.25575579877045 1.993906692108620e-121 2.330262419375648e-05 - ## 24 -272.26171350331560 1.993906692108620e-121 3.479081792127839e-03 - ## 54 -206.87380692051133 5.651548472141323e-96 3.947482857522776e-06 - ## 15 -249.38004723008990 1.863534817449074e-115 3.755916426362859e-07 - ## 32 -212.71747649505872 2.398083445189123e-99 5.779503581448713e-07 - ## 34 -221.42043358745988 2.398083445189123e-99 3.479659742485983e-03 - ## 8 -263.04327505088213 7.767176191416143e-121 1.344330380025045e-06 - ## 4 -270.17342327293881 2.103903029919092e-121 4.548336665057549e-04 - ## 49 -204.78551669013453 5.963323159168848e-96 5.160695289252128e-07 - ## 20 -214.30077028467304 2.612579111182405e-99 3.066983590733346e-06 - ## 26 -219.30672798921816 2.612579111182405e-99 4.579006500964880e-04 - ## 52 44.46486859948860 5.000000000000000e-01 2.444122297210018e-20 - ## 58 39.45891089494345 5.000000000000000e-01 3.649074589734563e-18 + ## 1 -296.86556566384121 3.379602789911592e-130 2.857213509222646e-01 + ## 43 -291.14874109223410 1.292116044135405e-129 3.594125092756943e-03 + ## 51 -248.52171108452393 5.273447194639989e-112 4.505078457280588e-04 + ## 19 -251.55063674163412 1.145038585671160e-112 2.022430368641518e-03 + ## 47 -245.83381217002702 4.377800646029406e-112 2.544040798080149e-05 + ## 57 -203.20678216231687 1.786689410775372e-94 3.188843765335484e-06 + ## 25 -256.50840723650504 1.145038585671160e-112 2.877437812909061e-01 + ## 48 -250.79158266489793 4.377800646029406e-112 3.619565500737745e-03 + ## 60 -208.16455265718778 1.786689410775372e-94 4.536966894933943e-04 + ## 13 -285.96367096648606 1.269973004681962e-128 1.978057058433490e-04 + ## 39 -245.60651253914989 4.302778117778702e-111 1.992058401535673e-04 + ## 16 -242.60618917600937 3.547269740850954e-110 8.173789497658884e-05 + ## 46 -236.88936460440229 1.356219777871981e-109 1.028191342425847e-06 + ## 24 -197.29126025380225 1.201845595341200e-92 5.785678967843724e-07 + ## 41 -202.24903074867316 1.201845595341200e-92 8.231646287337325e-05 + ## 11 -247.95429377117480 9.799119276589166e-113 4.746446532784001e-05 + ## 33 -207.59713534383860 3.320026161293994e-95 4.780043453630311e-05 + ## 63 -159.25328076452138 5.180485321727610e-77 7.536878402088282e-08 + ## 35 -216.30009243623971 3.320026161293994e-95 2.877915817254423e-01 + ## 64 -167.95623785692246 5.180485321727610e-77 4.537720582774151e-04 + ## 5 -281.92839069892131 8.850063363117643e-127 2.437197660118470e-04 + ## 55 -233.58453611960402 1.380941628819001e-108 3.842823309946346e-07 + ## 29 -241.57123227158510 2.998477829008260e-109 2.454448952492300e-04 + ## 15 -271.02649600156610 3.325639804309154e-125 1.687278888621291e-07 + ## 38 -201.36291747131978 8.694051852001183e-92 2.454856689284907e-04 + ## 8 -241.52694470737168 2.569154832193061e-109 2.011914846943475e-04 + ## 56 -193.18309012805443 4.008844584596373e-91 3.172263537741010e-07 + ## 23 -196.21201578516460 8.704518247546595e-92 1.424099974483975e-06 + ## 31 -201.16978628003551 8.704518247546595e-92 2.026155846688315e-04 + ## 3 -254.28914797572975 1.376814852165920e-112 3.760532236689203e-02 + ## 45 -248.57232340412264 5.263945708643433e-112 4.730421170969218e-04 + ## 53 -205.94529339641250 2.148347267722183e-94 5.929375845638836e-05 + ## 21 -208.97421905352263 4.664767515759897e-95 2.661829286886174e-04 + ## 58 -160.63036447420538 7.278785910303555e-77 4.197008637472115e-07 + ## 27 -213.93198954839355 4.664767515759897e-95 3.787150529558064e-02 + ## 50 -208.21516497678650 1.783470225337442e-94 4.763904658996110e-04 + ## 62 -165.58813496907629 7.278785910303555e-77 5.971345932013548e-05 + ## 14 -243.38725327837460 5.173737280355348e-111 2.603427188846501e-05 + ## 40 -203.03009485103840 1.752906831482172e-93 2.621855108889141e-05 + ## 18 -200.02977148789788 1.445120615482184e-92 1.075796359027457e-05 + ## 42 -159.67261306056173 4.896193335546380e-75 1.083411202020283e-05 + ## 12 -205.37787608306331 3.992058770464637e-95 6.247053340130711e-06 + ## 37 -173.72367474812825 1.352543956376726e-77 3.787779656763368e-02 + ## 6 -239.35197301080981 3.605423311083427e-109 3.207726807421036e-05 + ## 30 -198.99481458347364 1.221548526706203e-91 3.230432160341607e-05 + ## 10 -198.95052701926022 1.046646825193821e-91 2.647989243710033e-05 + ## 32 -158.59336859192405 3.546129752273321e-74 2.666732588738429e-05 + ## 2 -252.21607651738455 1.003464844528235e-112 3.447882370093512e-03 + ## 44 -246.49925194577750 3.836524899349538e-112 4.337134940468225e-05 + ## 52 -203.87222193806730 1.565781305747932e-94 5.436408773305789e-06 + ## 20 -206.90114759517743 3.399825475879069e-95 2.440525354606058e-05 + ## 26 -211.85891809004835 3.399825475879069e-95 3.472287623639570e-03 + ## 49 -206.14209351844130 1.299847738839836e-94 4.367834618277343e-05 + ## 61 -163.51506351073110 5.305002165212598e-77 5.474889475444408e-06 + ## 17 -197.95670002955271 1.053248177456893e-92 9.863548738960371e-07 + ## 34 -162.94764619738197 9.857754721109126e-78 5.768217005433660e-07 + ## 36 -171.65060328978305 9.857754721109126e-78 3.472864445340112e-03 + ## 9 -196.87745556091502 7.628282714025517e-92 2.427835969735803e-06 + ## 4 -209.63965882927306 4.088010891981130e-95 4.537943265071782e-04 + ## 54 -161.29580424995581 6.378829380283159e-77 7.155149721169606e-07 + ## 22 -164.32472990706597 1.385053363056516e-77 3.212106564955436e-06 + ## 28 -169.28250040193689 1.385053363056516e-77 4.570064330721336e-04 + ## 7 -194.70248386435316 1.070515018248445e-91 3.870856928151778e-07 + ## 59 42.52839400921903 5.000000000000000e-01 1.694818367219328e-19 + ## 65 37.57062351434811 5.000000000000000e-01 2.411323787194438e-17 ## ## $iter.converge ## [1] 4 @@ -689,6 +724,8 @@ which returns a list with the following elements: - `matchesLink`: Deduped indices of the matched pairs from dataset A and dataset B. +- `max.zeta`: The posterior matching probability for each matched pair. + Other arguments to `dedupeMatches()` include: - `linprog`: Whether to use Winkler's linear assignment solution to the deduping problem. Recommended, but can be slow on larger data sets. If set to `FALSE`, then the deduping is conducted by iteratively selecting the matched pair for a given observation with the largest posterior match probability. Default is `TRUE`. @@ -890,9 +927,9 @@ summary(agg.out) ``` ## 95% 85% 75% Exact - ## 1 Match Rate All 29.762% 29.762% 29.762% 25.595% - ## 2 Within-State 14.286% 14.286% 14.286% 11.905% - ## 3 Across-State 15.476% 15.476% 15.476% 13.69% + ## 1 Match Rate All 27.473% 27.473% 27.473% 23.626% + ## 2 Within-State 14.286% 14.286% 14.286% 12.637% + ## 3 Across-State 13.187% 13.187% 13.187% 10.989% ## 4 FDR All 0% 0% 0% ## 5 Within-State 0% 0% 0% ## 6 Across-State 0% 0% 0%