get_valid_sources: Determine valid sources for estimation of a stratum of...

View source: R/estimate_mse.R

get_valid_sourcesR Documentation

Determine valid sources for estimation of a stratum of interest.

Description

Determine valid sources for estimation of a stratum of interest.

Usage

get_valid_sources(stratum_data_prepped, min_n = 1)

Arguments

stratum_data_prepped

A data frame with all records in a stratum of interest. Columns indicating sources should be prefixed with in_ and should be numeric with 1 indicating that an individual was documented in the source and 0 indicating that an individual was not documented in the source.

min_n

The minimum number of records that must appear in a source to be considered valid for estimation. min_n should never be less than or equal to 0; the default value is 1.

Value

A character vector containing the names of the valid sources.

Examples

set.seed(19481210)
in_A <- sample(c(0, 1), size = 100, replace = TRUE, prob = c(0.45, 0.65))
in_B <- sample(c(0, 1), size = 100, replace = TRUE, prob = c(0.5, 0.5))
in_C <- sample(c(0, 1), size = 100, replace = TRUE, prob = c(0.75, 0.25))
in_D <- sample(c(0, 1), size = 100, replace = TRUE, prob = c(1, 0))

my_stratum <- tibble::tibble(in_A, in_B, in_C, in_D)
get_valid_sources(my_stratum)

verdata documentation built on June 8, 2025, 11:46 a.m.