Package: svrep 0.9.1.9000

svrep: Tools for Creating, Updating, and Analyzing Survey Replicate Weights

Provides tools for creating and working with survey replicate weights, extending functionality of the 'survey' package from Lumley (2004) <doi:10.18637/jss.v009.i08>. Implements bootstrap methods for complex surveys, including the generalized survey bootstrap as described by Beaumont and Patak (2012) <doi:10.1111/j.1751-5823.2011.00166.x>. Methods are provided for applying nonresponse adjustments to both full-sample and replicate weights as described by Rust and Rao (1996) <doi:10.1177/096228029600500305>. Implements methods for sample-based calibration described by Opsomer and Erciulescu (2021) <https://www150.statcan.gc.ca/n1/pub/12-001-x/2021002/article/00006-eng.htm>. Diagnostic functions are included to compare weights and weighted estimates from different sets of replicate weights.

Authors:Ben Schneider [aut, cre]

svrep_0.9.1.9000.tar.gz
svrep_0.9.1.9000.zip(r-4.7)svrep_0.9.1.9000.zip(r-4.6)svrep_0.9.1.9000.zip(r-4.5)
svrep_0.9.1.9000.tgz(r-4.6-any)svrep_0.9.1.9000.tgz(r-4.5-any)
svrep_0.9.1.9000.tar.gz(r-4.7-any)svrep_0.9.1.9000.tar.gz(r-4.6-any)
svrep_0.9.1.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
svrep/json (API)

# Install 'svrep' in R:
install.packages('svrep', repos = c('https://bschneidr.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bschneidr/svrep/issues

Pkgdown/docs site:https://bschneidr.github.io

Datasets:

On CRAN:

Conda:

7.85 score 10 stars 3 packages 56 scripts 486 downloads 32 exports 15 dependencies

Last updated from:d8d48c5f19. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK211
source / vignettesOK238
linux-release-x86_64OK206
macos-release-arm64OK214
macos-oldrel-arm64OK241
windows-develOK301
windows-releaseOK138
windows-oldrelOK280
wasm-releaseOK157

Exports:add_inactive_replicatesas_bootstrap_designas_data_frame_with_weightsas_fays_gen_rep_designas_gen_boot_designas_random_group_jackknife_designas_sdr_designcalibrate_to_estimatecalibrate_to_samplederive_twophase_rep_designestimate_boot_reps_for_target_cvestimate_boot_sim_cvget_design_quad_formget_nearest_psd_matrixget_rep_scale_coefsget_rep_typeis_psd_matrixmake_doubled_half_bootstrap_weightsmake_fays_gen_rep_factorsmake_gen_boot_factorsmake_kernel_var_matrixmake_quad_form_matrixmake_rwyb_bootstrap_weightsmake_sdr_replicate_factorsmake_twophase_quad_formredistribute_weightsrescale_replicatesshuffle_replicatesstack_replicate_designssubsample_replicatessummarize_rep_weightssvyby_repwts

Dependencies:DBIlatticelpSolveMASSMatrixminqamitoolsmvtnormnumDerivRcppRcppArmadillorlangsamplingsurveysurvival

Replication Methods for Two-phase Sampling
Two-phase Sampling vs. Multistage Sampling | Applications of Two-Phase Sampling | Replicate Variance Estimation with the 'svrep' Package | Overview of the Generalized Bootstrap | Creating Example Data | Describing the Two-phase Survey Design | Creating Generalized Bootstrap Replicates | Create Replicates Using Fay's Generalized Replication Method | Calibrating Second-phase Weights to First-phase Estimates | Preliminaries | Option 1: Calibrate to a set of estimates and their variance-covariance matrix | Option 2: Calibrate to independently-generated first-phase replicates | Ratio Estimation | Design-based Estimators for Two-phase Sampling | Notation | Notation for Samples and Sample Size | Notation for Probabilities and Weights | The Double Expansion Estimator | Variance of the Double Expansion Estimator | Estimating the Variance of the Double Expansion Estimator | Estimating the second-phase variance component | Estimating the first-phase variance component | Combining the two estimated variance components | Calibration Estimators | Variance of the Calibration Estimator | Replication Variance Estimation | Ensuring the Variance Estimator is Positive Semidefinite | Usage with the Generalized Bootstrap | Helper Functions for Ensuring an Estimator is Positive Semidefinite | References

Last update: 2025-09-17
Started: 2023-02-05

Bootstrap Methods for Surveys
Choosing a Bootstrap Method | Basic Bootstrap Methods | Implementation | Extracting Bootstrap Replicate Weights | Generalized Survey Bootstrap | Statistical Background | Details and Notation for the Generalized Survey Bootstrap Method | Quadratic Forms | Forming Adjustment Factors | Adjusting Generalized Survey Bootstrap Replicates to Avoid Negative Weights | Option 1: Convert an existing design to a generalized bootstrap design | Option 2: Create the quadratic form matrix and then use it to create bootstrap weights | Choosing the Number of Bootstrap Replicates | General Strategy | Measuring and Estimating Simulation Error | The Bootstrap vs. Other Replication Methods | References

Last update: 2025-09-14
Started: 2022-12-11

Nonresponse Adjustments
Creating initial replicate weights | Redistributing weight from nonrespondents to respondents | Conducting weighting class adjustments | Propensity cell adjustment | Saving the final weights to a data file | Statistical background | Recommended Reading

Last update: 2023-05-31
Started: 2022-06-27

Calibrating to Estimated Control Totals
Sample-based Calibration: An Introduction | Functions for Implementing Sample-Based Calibration | An Example Using a Vaccination Survey | Raking to estimated control totals | Post-stratification | Reproducibility | References

Last update: 2023-02-05
Started: 2022-05-12

Readme and manuals

Help Manual

Help pageTopics
Add Inactive Replicates to a Survey Design Objectadd_inactive_replicates
Convert Survey Design to Bootstrap Replicate Designas_bootstrap_design
Convert Survey Design to Data Frameas_data_frame_with_weights
Convert Survey Design to Fay's Generalized Replication Designas_fays_gen_rep_design
Convert Survey Design to Generalized Bootstrap Replicate Designas_gen_boot_design
Convert Survey Design to Random Group Jackknife Replicate Designas_random_group_jackknife_design
Convert Survey Design to Successive Differences Replicate Designas_sdr_design
Sample-based Calibration to An Estimatecalibrate_to_estimate
Sample-based Calibration with Replicatescalibrate_to_sample
Replicate Design Object for a Two-phase Samplederive_twophase_rep_design
Control Bootstrap Simulation Errorestimate_boot_reps_for_target_cv
Estimate Bootstrap Simulation Errorestimate_boot_sim_cv
Quadratic Form Matrix of Variance Estimator for a Survey Designget_design_quad_form
Positive Semidefinite Matrix Approximationget_nearest_psd_matrix
Access Replication Scale Coefficientsget_rep_scale_coefs
Access Type of Replication Methodget_rep_type
Check if Matrix is Positive Semidefiniteis_psd_matrix
U.S. Public Libraries Surveylibraries library_census library_multistage_sample library_stsys_sample
Auxiliary Data for Louisville Vaccination Surveylou_pums_microdata
Data of Louisville Vaccination Surveylou_vax_survey
Control Totals for Louisville Vaccination Surveylou_vax_survey_control_totals
Weights for "Doubled Half Bootstrap" of Antal and Tillé (2014)make_doubled_half_bootstrap_weights
Factors for Fay's Generalized Replication Methodmake_fays_gen_rep_factors
Factors for the Generalized Survey Bootstrapmake_gen_boot_factors
Quadratic Form Matrix of Kernel-based Variance Estimatormake_kernel_var_matrix
Get Variance Estimator's Quadratic Form Matrixmake_quad_form_matrix
Weights for Rao-Wu-Yue-Beaumont Bootstrapmake_rwyb_bootstrap_weights
Factors for the Successive Difference Replication Methodmake_sdr_replicate_factors
Quadratic Form Matrix for a Two-phase Designmake_twophase_quad_form
Weighting Class Adjustmentredistribute_weights
Rescale Replicate Factorsrescale_replicates
Shuffle Order of Replicates in a Replicate Design Objectshuffle_replicates
Combine Replicate Designs by Stackingstack_replicate_designs
Subsample Replicates in a Replicate Design Objectsubsample_replicates
Summarize Replicate Weights in a Replicate Designsummarize_rep_weights
Package-level Options for svrepsvrep-package-options
Survey Statistics for Multiple Replicate Design Objectssvyby_repwts
Variance Estimatorsvariance-estimators