
Model specific, linkage score based, false discovery proportion at a given threshold
Source:R/FlexRecordLinkage.r
FDP_score.RdModel specific, linkage score based, false discovery proportion at a given threshold
Value
A list with FDP_score Numeric, 1 - mean(score | score > threshold),
the estimated FDP at threshold and n_linked Integer, number of linked
records.
Examples
PIVs_config <- list( V1 = list(dynamics = "stable",
bound_mistakes = c(0.10,0.10),
fix_mistakes = c(NA,NA)),
V2 = list(dynamics = "stable",
bound_mistakes = c(0.10,0.10),
fix_mistakes = c(NA,NA)),
V3 = list(dynamics = "flexible",
bound_mistakes = c(NA,NA),
fix_mistakes = c(NA,NA)),
V4 = list(dynamics = "structured",
bound_mistakes = c(NA,NA),
fix_mistakes = c(0.03,0.03),
cond_hazard_cov = list(cov1=c("Xe", "Xf"),
cov2=c())) )
n_values <- c( 5, 6, 7, 12 )
p_mistake <- list( V1 = c(0.02, 0.02), V2 = c(0.02, 0.02),
V3 = c(0.05, 0.05), V4 = c(0.02, 0.02) )
p_missing <- list( V1 = c(0.005, 0.005), V2 = c(0.005, 0.005),
V3 = c(0.005, 0.005), V4 = c(0.005, 0.005) )
cond_hazard_params <- list( V1 = c(), V2 = c(),
V3 = c(), V4 = log(c(0.7, 0.6, 0.5)) )
gen_data <- simulate_data( PIVs_config, n_values, c(150, 200), 100,
p_mistake, p_missing, cond_hazard_params, TRUE )
prep_data <- prepare_data( gen_data$data1, gen_data$data2, "1", "2",
PIVs_config, TRUE, "entity_id", TRUE )
#> Warning: PIVs 'V4' and 'V1' are associated (Cramer's V = 0.29 in data1, 0.31 in data2); FlexRL assumes conditional independence between PIVs, consider merging or dropping one.
#> Warning: PIVs 'V4' and 'V3' are associated (Cramer's V = 0.32 in data1, 0.21 in data2); FlexRL assumes conditional independence between PIVs, consider merging or dropping one.
#> '2' is the larger source, saved as B; '1' saved as A.
fit <- StEM( data = prep_data, StEM_iter = 10, StEM_burnin = 5,
gibbs_iter = 10, gibbs_burnin = 5, n_post_sample = 10 )
#> FlexRL
FDP_score(fit$Delta$x, 0.5)
#> $FDP_score
#> [1] 0.1139785
#>
#> $n_linked
#> [1] 93
#>
FDP_score(fit$Delta$x, 0.75)
#> $FDP_score
#> [1] 0.04383562
#>
#> $n_linked
#> [1] 73
#>