Two-Level Sample Selection with Optimal Site Replacement
Overview
Carries out a two-level sample selection where the possibility of an initially selected site not wanting to participate is anticipated, and the site is optimally replaced. The procedure aims to reduce bias (and/or loss of external validity) with respect to the target population. In selecting units and sub-units, 'sitepickR' uses the cube method developed by 'Deville & Tillé', (2004) http://www.math.helsinki.fi/msm/banocoss/Deville_Tille_2004.pdf and described in Tillé (2011) https://www150.statcan.gc.ca/n1/en/pub/12-001-x/2011002/article/11609-eng.pdf?st=5-sx8Q8n. The cube method is a probability sampling method that is designed to satisfy criteria for balance between the sample and the population. Recent research has shown that this method performs well in simulations for studies of educational programs (see Fay & Olsen (2021, under review). To implement the cube method, 'sitepickR' uses the sampling R package https://cran.r-project.org/package=sampling. To implement statistical matching, 'sitepickR' uses the 'MatchIt' R package https://cran.r-project.org/package=MatchIt.
Install
Health
NOTERd filesr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64
checkRd: (-1) rawCCD.Rd:20: Lost braces; missing escapes or markup?
20 | \item{distr.type}{school district type (constructed for illustration purposes; (values={"A", "B", "C", "D"})).}
| ^
checkRd: (-1) selectMatch.Rd:61: Lost braces; missing escapes or markup?
61 | \item{replacementUnitsFilename}{character; csv filename for saving {unit:replacement} directory when writeOut == TRUE; default = "replacementUnits.csv"}
| ^
checkRd: (-1) selectMatch.Rd:63: Lost braces; missing escapes or markup?
63 | \item{subUnitTableFilename}{character; csv filename for saving {unit:replacement} directory when writeOut == TRUE; default = "subUnitTable.csv"}
| ^
checkRd: (-1) selectMatch.Rd:66: Lost braces; missing escapes or markup?
66 | list with: 1) table of the form: {selected unit i: (unit i replacements)}, 2) table of the form: {potential unit i:(unit i sub-units)}, 3) balance diagnostics.
| ^
checkRd: (-1) selectMatch.Rd:66: Lost braces; missing escapes or markup?
66 | list with: 1) table of the form: {selected unit i: (unit i replacements)}, 2) table of the form: {potential unit i:(unit i sub-units)}, 3) balance diagnostics.
| ^NOTEdependencies in R coder-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Namespace in Imports field not imported from: ‘data.table’ All declared Imports should be used.
- NOTE13 NOTE2026-06-09
- ERROR12 NOTE, 1 ERROR2026-06-07
- NOTE14 NOTE2026-04-10
- ERROR13 NOTE, 1 ERROR2026-04-09
- NOTE14 NOTE2026-03-10
Documentation
- Help pages
- 10 (1 internal)includes a package overview page
- Examples that run
- 100%8 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 96%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- sitepickR-demo HTML
Downloads
Dependencies
Installing sitepickR adds 38 packages (22 with compiled code, 39 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.0.1Latest2022-12-05 · current release
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2022-12-05
- Total releases
- 1 / 4 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 84 KB / 1 file
- Download size
- 374 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("sitepickR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.