Resolve overlap probabilities from the designs, instead of stating them
Source:R/exante-probabilities.R
exante_overlaps.RdA 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. It is exact, and it is checked against what actually happened, because a component's own resolved chance has to equal the design weight the execution produced.
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.
- 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").
Value
An object of class samplyr_exante_overlap_spec, for
stack_frames()'s overlaps argument.
See also
exante_probabilities() for one register,
overlap_probabilities() for stating the chances instead
Other multiple frames:
as.data.frame.frame_stack(),
as_svrepdesign.frame_stack(),
as_svydesign.frame_stack(),
exante_probabilities(),
overlap_probabilities(),
overlap_weights(),
stack_frames(),
summary.frame_stack()
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