check.strata: Checks Each Stratum for Suitability for Capture-Recapture

Description Usage Arguments Value Note Author(s) Examples

View source: R/stratify_functions.R

Description

Takes in list intersection counts and source list totals as produced by make.strata. It then checks whether there are between three and five lists, whether all of the lists are non-empty, and whether all of the lists overlap with some other list.

Usage

1
check.strata(strata)

Arguments

strata

A list of list overlaps and source countsin the format of the output of make.strata. list.overlaps contains a data frame of list overlaps by stratum. source.counts contains the number of records by source and stratum.

Value

A boolean indicating whether any serious problems have been found with the strata.

Note

This does not issue a warning for cases where some subset of lists is not connected to the others, e.g. Lists A and B have overlap with each other, lists C and D have overlap with each other, but no records from A or B overlap with lists C or D. We suggest that you examine the list intersection counts manually as well.

Author(s)

Kristian Lum kl@hrdag.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(chron)

N <- 1000
overlaps <- data.frame(l1 = rbinom(N, 1, .5), l2 = rbinom(N, 1, .5), l3 = rbinom(N, 1, .5))
dates <- paste(
  rep(2015, N), "-", sample(1:12, N, replace = TRUE), "-",
  sample(1:28, N, replace = TRUE)
)
dates <- chron(dates, format = c(dates = "y-m-d"))
locations <- sample(c("A", "B", "C", "D"), N, replace = TRUE)

# Aggregate only by week:
strata <- make.strata(overlaps, dates, date.def = "weekly")
check <- check.strata(strata)

dga documentation built on May 10, 2021, 5:06 p.m.