MyNixOS website logo
Description

Inference for Nonprobability Samples Using Multiple Reference Surveys.

Provides pseudo-weighted estimates of means and prevalences for finite population inference from nonprobability samples using auxiliary information from one or multiple probability reference surveys. The package supports estimation with multiple reference surveys, allowing auxiliary information to be combined when no single survey contains all variables relevant to participation. Optional cumulative precalibration can be applied to align weighted totals of shared variables across surveys. Methods are based on the generalized estimating equations framework of Landsman et al. (2026) <doi:10.1002/sim.70403> for correcting participation bias. For a single reference survey, the package implements the raking ratio calibration method and includes the adjusted logistic propensity (ALP) method of Wang, Valliant, and Li (2021) <doi:10.1002/sim.9122>, as well as the Chen-Li-Wu (CLW) method of Chen, Li, and Wu (2020) <doi:10.1080/01621459.2019.1677241>. Analytic variance estimation uses Taylor linearization and accounts for complex sampling designs in the reference surveys via integration with the 'survey' package.

nonprobsampling

CRAN status pkgdown site License: GPL v3

Inference for Nonprobability Samples Using Multiple Reference Surveys

nonprobsampling implements pseudo-weighting methods for finite population inference from nonprobability samples, such as convenience samples, volunteer cohorts, and opt-in panels. Because the participation mechanism in a nonprobability sample is unknown, unadjusted estimates of population means and prevalences may be biased. The package addresses this issue by leveraging auxiliary information from one or multiple probability reference surveys to estimate participation probabilities and using their inverses as pseudo-weights to obtain bias-corrected estimates of finite population means and prevalences.

The implemented methods are based on the generalized estimating equations framework of Landsman et al. (2026). This includes a multi-reference extension that enables the integration of auxiliary information across multiple reference surveys.

Installation

Install the released version from CRAN (once available):

install.packages("nonprobsampling")

Install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("Jiakun0611/nonprobsampling")

Methods

With one reference survey:

  • Calibration — raking ratio calibration (Landsman et al., 2026)
  • ALP — adjusted logistic propensity weighting (Wang, Valliant, and Li, 2021)
  • CLW — Chen, Li, and Wu (2020)

With multiple reference surveys:

  • Multi-reference calibration — enables the integration of auxiliary information across multiple surveys when no single reference survey contains all variables relevant to participation (Landsman et al., 2026), with an optional cumulative precalibration step to preserve information on the relationships between overlapping and unique auxiliary variables across reference surveys.

Variance estimation is based on Taylor linearization, with complex sampling designs in the reference surveys handled through integration with the survey package; when bootstrap replicate weights are provided, bootstrap-based variance estimation is also supported.

Usage

Estimation proceeds in two steps: est_pw() estimates pseudo-weights, then pwmean() estimates a pseudo-weighted mean or prevalence for an outcome.

library(nonprobsampling)

data(sc)    # nonprobability sample (outcome: psa_level)
data(sp1)   # probability reference survey

# Reference survey design
ref1_design <- survey::svydesign(
  ids     = ~psu_sp1,
  strata  = ~strata_sp1,
  weights = ~wts_sp1,
  data    = sp1,
  nest    = TRUE
)

# Step 1: estimate pseudo-weights (one-reference calibration)
fit <- est_pw(
  data      = list(sc, ref1_design),
  p_formula = ~ agecat + race + education + comorbidity + BMI + diabetes,
  method    = "calibration",
  control   = pw_solver_control(ftol = 1e-6)
)
print(fit)
summary(fit)

# Step 2: pseudo-weighted mean of the outcome, by BMI categories
out <- pwmean(fit, y = "psa_level", zcol = "BMI")
print(out)
summary(out)

With multiple reference surveys, users provide one survey design object for each reference survey and a corresponding list of participation model formulas, with one formula specified for each survey.

data(sp2)   # second probability reference survey

ref2_design <- survey::svydesign(
  ids     = ~psu_sp2,
  strata  = ~strata_sp2,
  weights = ~wts_sp2,
  data    = sp2,
  nest    = TRUE
)

fit2 <- est_pw(
  data = list(sc, ref1_design, ref2_design),
  p_formula = list(
    ~ agecat + race + education + psa_level + pros_enlarged + comorbidity,
    ~ agecat + race + BMI + diabetes + comorbidity
  ),
  sp_order = "size",
  precali = TRUE,
  control = pw_solver_control(ftol = 1e-6)
)
print(fit2)
summary(fit2)

See vignette("nonprobsampling") for more details.

Datasets

The package includes example datasets used throughout the documentation:

DatasetDescription
scNonprobability sample (synthetic, NHANES-based)
sp1First probability reference survey (NHANES 1999–2010)
sp2Second probability reference survey (NHIS 1997–2008)
sp1_bootstrapsp1 with bootstrap replicate weights

Getting help

Run any of the following commands in R to open the corresponding help page (clickable links are available on the package website):

## Package overview
?nonprobsampling

## Main functions
?est_pw
?pwmean
?pw_solver_control

## Datasets
?sc
?sp1
?sp2
?sp1_bootstrap

## Vignette
vignette("nonprobsampling")

Citation

To cite the package in publications, run:

citation("nonprobsampling")

References

  • Chen, Y., Li, P., and Wu, C. (2020). Doubly robust inference with nonprobability survey samples. Journal of the American Statistical Association, 115(532), 2011–2021. doi:10.1080/01621459.2019.1677241
  • Landsman, V., Wang, L., Carrillo-Garcia, I., Mitani, A. A., Smith, P. M., Graubard, B. I., Bui, T., and Carnide, N. (2026). Correction for participation bias in nonprobability samples using multiple reference surveys. Statistics in Medicine, 45(3–5). doi:10.1002/sim.70403
  • Wang, L., Valliant, R., and Li, Y. (2021). Adjusted logistic propensity weighting methods for population inference using nonprobability volunteer-based epidemiologic cohorts. Statistics in Medicine, 40(24), 5237–5250. doi:10.1002/sim.9122

License

GPL-3 © Jiakun Lin, Victoria Landsman, Aya A. Mitani.

Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows