Skip to contents

Drawing a sample

One verb, and the designs it takes.

draw()
Draw a sample
designs
Sampling designs
plot(<drawn_design>)
Picture a sampling design
is_design()
Is this a sampling design?

What a design knows before you draw

The probabilities that make a sample estimable.

inclusion_prob() sampling_weight()
Inclusion probabilities and design weights
joint_prob()
Joint inclusion probabilities
certainty_set()
Rows a size-proportional design takes with certainty
allocation_table()
How a design splits its sample over the strata of a frame

Estimating from a sample

Totals, means, ratios, proportions and quantiles, overall or by domain, with the variance estimator the design calls for and a design effect.

ht_total()
Estimate a population total from a sample
ht_mean()
Estimate a population mean
ht_ratio()
Estimate a ratio of two population totals
ht_quantile()
Estimate population quantiles from a sample
deff()
Design effect

From fieldwork to estimate

Join fieldwork results to a sample, replace units found unavailable from a reserve list, rebuild a sample read back from a file, and drop frame columns before saving or sharing one.

add_fieldwork()
Join fieldwork results to a weighted sample
use_reserves()
Replace unavailable units from a reserve list
as_drawn()
Rebuild a weighted sample from its rows
compact_sample()
Drop the frame columns a sample's design does not need

Planning and checking

How many rows to draw, what you actually got, and where to go next.

plan_size()
How large a sample do you need?
deff_cluster()
Design effect of a cluster sample, from the intraclass correlation
sample_summary()
Describe a drawn sample
as_svydesign()
Hand a sample to the survey package
replicate_weights()
Replicate weights for a sample
frame_totals()
Population totals from the frame behind a sample

Equal-probability designs

Every unit equally likely, or equally likely within a group.

design_simple()
Simple random sampling
design_systematic()
Systematic sampling
design_stratified()
Stratified sampling
design_reservoir()
Reservoir sampling

Cluster designs

Sample groups, then optionally sample within them.

design_cluster()
Cluster sampling
design_multistage()
Multi-stage sampling

Unequal-probability designs

Selection driven by size, and units too big to leave to chance.

design_weighted()
Weighted sampling
design_certainty()
Take some rows with certainty, sample the rest

Space and time

A sample spread evenly over a map or over covariates, restricted to a region, or taken across time intervals.

design_spread()
Spatially balanced sampling
design_spatial()
Sampling within a region
design_temporal()
Temporal sampling

Resampling

design_bootstrap()
Bootstrap sampling

Extending

A design class of your own, drawn by its own method.

draw_design()
Draw method for a design class