Skip to contents

A declarative marker for stack_frames()'s overlaps argument. Instead of naming columns that already hold the chance each unit had in every frame, it names the registers, and samplyr resolves the chances from each component's own design with exante_probabilities().

This is the capability the expected multiframe estimator needs and that a sample alone cannot supply: the probability a unit would have had in a frame it was not selected from. Exact inclusion probabilities are required by default. With allow_approximate = TRUE, approximate targets may be used instead. The resulting estimator need not be design-unbiased. A component's own resolved chance must equal the reciprocal of its execution weight. This consistency check cannot establish the exactness of approximate targets.

Resolved stacks retain a named, per-frame probability_quality vector in their overlaps attribute. Survey exports retain that vector in the samplyr_overlap_probability_quality attribute, and printing a stack identifies accepted approximate probabilities.

Usage

exante_overlaps(frames, ..., by, allow_approximate = FALSE)

Arguments

frames

A named list of registers, one per frame, with the same names as the components of the stack. Each is the population the corresponding design would draw from.

...

Must be empty. Arguments after it are matched by exact name.

by

A single named string matching the stack's key to the column holding it in the registers, in the same direction as a join: by = c(person_id = "person_id").

allow_approximate

Logical, default FALSE. Allow approximate probability targets when resolving the component designs. See exante_probabilities() for the statistical limitations.

Value

An object of class samplyr_exante_overlap_spec, for stack_frames()'s overlaps argument.

Examples

exante_overlaps(
  frames = list(
    area = data.frame(person_id = 1:10),
    list = data.frame(person_id = 5:14)
  ),
  by = c(person_id = "person_id")
)
#> ℹ Overlap probabilities to resolve from 2 registers, keyed by person_id