Skip to contents

periods() is used inside execute(panels = ) to spread the selected units over k fieldwork periods, such as the months of a yearly survey. Each unit is assigned to exactly one period, certainty units included, and each stratum's units are spread as evenly as the count allows. execute(sample, wave = t) returns the sample of period t with its weights. For rotation groups, which can be active at several waves, pass a count or a schedule to panels instead (see panel_assignment).

Usage

periods(k)

Arguments

k

The number of periods, a whole number of at least 2.

Value

A samplyr_periods object, for the panels argument of execute().

Details

Periods and rotation groups

panels takes three forms. A count, panels = 12, makes 12 rotation groups whose waves a schedule or rotation_program() can declare later. A schedule makes rotation groups and declares their waves. In both, a unit selected with certainty is kept apart from the rotating units and is active at every wave. panels = periods(12) makes 12 periods instead. A unit belongs to one period only, whether or not it was selected with certainty, so it is visited once.

The assignment is the one panel_assignment describes, randomized with fixed quotas within each stratum along the frame order, so every period spreads over the stratum like the whole sample. The periods are recorded in the .panel column.

Equal periods

A stratum gets the same number of units in every period when its sample size is a multiple of k. Survey programs that publish estimates by period allocate in such multiples, for example 24 EAs per district over 12 months. Otherwise the counts differ by one between periods. A stratum with fewer than k units is refused, since some period would hold none of its units and could not estimate it.

Weights

The full-sample .weight is valid for the combined sample. A period's own weights come from execute(sample, wave = t), which multiplies .weight by the exact inverse of the period's activation chance, the block's quota for that period over the block size. That factor is k when a stratum's units fill whole blocks evenly, and it differs from k otherwise, so multiplying by k by hand is not generally valid. summary() reports how evenly each stratum fills the periods.

A period exports to survey as one phase by ultimate clusters, whatever method drew the sample, EAs drawn by size included. as_svydesign() describes the design. A period of a sample drawn with equal probabilities also has a two-phase export, the activation as its second phase, with as_svydesign(method = "full").

Periods in a multistage design

Periods assigned at the first stage of a multistage design give the field teams their work plan. dplyr::filter(sample, .panel == t) lists the primary units of period t, which is what the listing teams need. That table is a work list, not a sample to continue. Its weights describe the whole year without the period's activation factor, and as_svydesign() refuses a stage drawn from it (samplyr_error_modified_sample).

The later stages are drawn from the sample itself, either for one period with that period's listing, sample <- execute(sample, listing, wave = t), or for every period at once, execute(sample, listing). The section "Drawing the later stages wave by wave" of execute() states the rules of the first form. execute(sample, wave = t) gives a period's sample and weights once its later stages are drawn.

Examples

# Spread 24 EAs per region over 12 months
monthly <- sampling_design() |>
  stratify_by(region) |>
  draw(n = 24, method = "pps_systematic", mos = households,
       control = c(province, commune)) |>
  execute(bfa_eas, seed = 1, panels = periods(12))

# Every region has two EAs in each month
table(monthly$region, monthly$.panel)[1:3, ]
#>                    
#>                     1 2 3 4 5 6 7 8 9 10 11 12
#>   Boucle du Mouhoun 2 2 2 2 2 2 2 2 2  2  2  2
#>   Cascades          2 2 2 2 2 2 2 2 2  2  2  2
#>   Centre            2 2 2 2 2 2 2 2 2  2  2  2
summary(monthly)
#> ── Sample Summary ──────────────────────────────────────────────────────────────
#> 
#> ℹ n = 312 of 44,570 | stages = 1/1 | seed = 1
#> ℹ Periods: 12, even in all 13 strata (2 units per period).
#> 
#> ── Stage 1 ─────────────────────────────────────────────────────────────────────
#> • pps_systematic, MOS households, by region
#> • 13 strata: N_h 1,612-5,505, n_h 24, f_h 0.0044-0.0149
#> 
#> ── Weights ─────────────────────────────────────────────────────────────────────
#> • Mean 149.14 [11.77, 1836.65] | CV 1.27 | Kish DEFF 2.61 | n_eff 119
#> 

# The sample of the third month, with its own weights
march <- execute(monthly, wave = 3)
nrow(march)
#> [1] 26

# A unit taken with certainty is assigned to one period like any other
poura <- subset(bfa_eas, commune == "Poura" & urban_rural == "Urban")
small <- sampling_design() |>
  draw(n = 12, method = "pps_systematic", mos = households) |>
  execute(poura, seed = 1, panels = periods(12))
#> Stage 1: 1 unit is selected with certainty.
#> ℹ A unit whose share of its pool's size is above 1 / n has chance 1, and the
#>   rest of the take is spread over the other units.
#> ℹ Set `certainty_size` or `certainty_prop` in `draw()` to state the rule in the
#>   design, or check before drawing with `frame_summary()`.
tabulate(small$.panel, 12)
#>  [1] 1 1 1 1 1 1 1 1 1 1 1 1