Package: surveycore 1.1.0

surveycore: Core Survey Analysis Infrastructure

A modern, 'S7'-based foundation for survey analysis spanning both probability and non-probability samples. Probability sample designs include Taylor series linearization, replicate weights (BRR, Fay, jackknife, bootstrap), and two-phase estimation, following 'Lumley' (2004) <doi:10.18637/jss.v009.i08>. Non-probability sample designs support bootstrap and jackknife variance estimation for opt-in panels and convenience samples. Provides a unified estimator interface for means, frequencies, totals, quantiles, ratios, correlations, regression, and t-tests, with weighted 'polychoric' and 'polyserial' correlation following 'Mannan' (2025) <doi:10.2139/ssrn.6580480>. A metadata system preserves 'haven'-style variable labels, value labels, and question-preface attributes through all operations. Uses a 'tidyselect' interface throughout.

Authors:Jacob Dennen [aut, cre, cph], Thomas Lumley [ctb, cph]

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

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

Bug tracker:https://github.com/jdenn0514/surveycore/issues

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

Datasets:
  • acs_pums_wy - ACS PUMS 2022 1-Year: Wyoming Persons
  • anes_2024 - ANES 2024: American National Election Studies Time Series
  • ca_api_2000 - California Academic Performance Index 2000: Simple Random Sample
  • gss_2024 - GSS 2024: General Social Survey
  • nhanes_2017 - NHANES 2017-2018: Demographics and Blood Pressure
  • ns_wave1 - Nationscape Wave 1: July 18, 2019
  • pew_jewish_2020 - Pew Jewish Americans 2020
  • pew_npors_2025 - Pew NPORS 2025: National Public Opinion Reference Survey

On CRAN:

Conda:

dataresearsurvey-analysis

5.96 score 1 stars 1 packages 17 scripts 291 downloads 65 exports 23 dependencies

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

TargetResultTimeFilesSyslog
linux-devel-x86_64OK333
source / vignettesOK263
linux-release-x86_64OK321
macos-release-arm64OK210
macos-oldrel-arm64OK262
windows-develOK345
windows-releaseOK334
windows-oldrelOK340
wasm-releaseOK183

Exports:.get_design_vars_flatadd_surveyas_caldataas_surveyas_survey_collectionas_survey_nonprobas_survey_replicateas_survey_twophaseas_svydesignas_tbl_svyclassify_question_typecleanextract_higher_isextract_metadataextract_missing_codesextract_question_prefaceextract_reverse_codedextract_sataextract_universeextract_val_labelsextract_var_labelextract_var_notefrom_svydesignfrom_tbl_svyget_anovaget_corrget_covarianceget_diffsget_effective_nget_freqsget_meansget_pairwiseget_quantilesget_ratiosget_t_testget_totalsget_varianceinfer_question_prefacesmetaremove_surveySEset_collection_idset_collection_if_missing_varset_higher_isset_missing_codesset_question_prefaceset_reverse_codedset_sataset_universeset_val_labelsset_var_labelset_var_notesurvey_basesurvey_collectionsurvey_datasurvey_glmsurvey_glm_fitsurvey_metadatasurvey_nonprobsurvey_replicatesurvey_taylorsurvey_twophasesurvey_weighting_historySURVEYCORE_DOMAIN_COLupdate_design

Dependencies:backportscheckmateclidata.tabledplyrFormulagenericsglueinsightlifecyclemagrittrmarginaleffectspbivnormpillarpkgconfigR6rlangS7tibbletidyselectutf8vctrswithr

Creating Survey Objects in surveycore
Introduction | 1. Decision Guide | Common surveys at a glance | 2. as_survey() — Taylor Series Designs | 2.1 Core arguments | 2.2 The nest argument | 2.3 The fpc argument | 2.4 Multi-level clustering | 2.5 Worked example: NHANES 2017–2018 | 2.6 Worked example: ANES 2024 | 2.7 Worked example: GSS 2024 | 2.8 Worked example: Pew NPORS 2025 | 3. as_survey_replicate() — Replicate Weight Designs | 3.1 The type argument | 3.2 Worked example: ACS PUMS 2022 — Wyoming | 3.3 Worked example: Pew Jewish Americans 2020 | 3.4 The scale and rscales arguments | 4. as_survey_twophase() — Two-Phase Designs | 4.1 What two-phase sampling is | 4.2 Arguments | 4.3 Worked example: National Wilms Tumor Study | 5. Simple Random Sample with as_survey() | 5.1 The fpc argument matters more here | 5.2 Worked example: School district survey | 6. as_survey_nonprob() — Non-Probability Samples | 6.1 The fundamental distinction | 6.2 Variance estimation: two modes | Choosing type | 6.3 What you can and cannot claim | 6.4 Worked example: Democracy Fund + UCLA Nationscape (SRS approximation) | 6.5 Worked example: Bootstrap replicate weights | 6.6 Worked example: University snowball sample | 7. When no constructor applies: convenience and purposive samples | 7.1 Example: program evaluation classrooms | 7.2 General decision rule | 8. Reference: Common Codebook Variables | References

Last update: 2026-06-08
Started: 2026-02-25

Getting Started with surveycore
Creating the survey object | as_survey() | as_survey_replicate() | as_survey_nonprob() | as_survey_twophase() | Analysis functions | Frequency tables — get_freqs() | Analyzing multiple variables at once | Weighted means — get_means() | Population totals — get_totals() | Weighted correlations — get_corr() | Ratio estimation — get_ratios() | Weighted quantiles — get_quantiles() | Treatment effects — get_diffs() | Two-sample t-test — get_t_test() | All-pairs comparisons — get_pairwise() | Population variance — get_variance() | Subgroup analysis — the group argument | Controlling uncertainty output | Regression | Summary

Last update: 2026-06-08
Started: 2026-02-26

surveycore vs. survey and srvyr
1. Creating Survey Design Objects | 1.1 Simple Random Sample | 1.2 Stratified Design | 1.3 Cluster Design | 1.4 Replicate Weights | 1.5 Calibrated / Non-Probability Samples | 1.6 Two-Phase Designs | 1.7 Constructor Summary | 2. Summary Statistics | 2.1 Weighted Means (Grouped) | 2.2 Proportions / Frequency Tables | 2.3 Population Totals | 2.4 Quantiles | 2.5 Ratios | 2.6 Correlations | 3. Controlling Uncertainty Output | 4. Features With No survey / srvyr Equivalent | 4.1 Automatic Value Labels | 4.2 Multiple Variables in One Call | 4.3 Minimum Cell Size Warnings | 4.4 Weighted Sample Size | 4.5 Metadata-Rich Results (.meta) | 5. Notable Differences | 6. Function Reference Table | 7. Learning More

Last update: 2026-04-27
Started: 2026-03-09

Readme and manuals

Help Manual

Help pageTopics
Get design variable column names.get_design_vars_flat
ACS PUMS 2022 1-Year: Wyoming Personsacs_pums_wy
Add Surveys to a 'survey_collection'add_survey
ANES 2024: American National Election Studies Time Seriesanes_2024
ANOVA Method for Survey GLM Fitsanova.survey_glm_fit
Build a Calibration Data Elementas_caldata
Create a Taylor Series Linearization Survey Designas_survey
Create a Collection of Survey Designsas_survey_collection
Create a Non-probability Survey Designas_survey_nonprob
Create a Replicate Weights Survey Designas_survey_replicate
Create a Two-Phase Survey Designas_survey_twophase
Convert a surveycore Design Object to a survey Package Designas_svydesign
Convert a surveycore Design Object to an srvyr tbl_svyas_tbl_svy
California Academic Performance Index 2000: Simple Random Sampleca_api_2000
Classify Variable Question Typesclassify_question_type
Tidy a Survey GLM Fitclean
Extract coefficients from a survey result objectcoef.survey_result
Confidence intervals for survey result objectsconfint.survey_result
Extract Direction-of-Improvement Attributesextract_higher_is
Extract All Metadata for Variablesextract_metadata
Extract Missing Value Codesextract_missing_codes
Extract Question Prefacesextract_question_preface
Extract Reverse-Coded Flagsextract_reverse_coded
Extract SATA (Select-All-That-Apply) Flagsextract_sata
Extract Universe Descriptionsextract_universe
Extract Value Labelsextract_val_labels
Extract Variable Labelsextract_var_label
Extract Analyst Notesextract_var_note
Convert a survey Package Design to a surveycore Design Objectfrom_svydesign
Convert an srvyr tbl_svy to a surveycore Design Objectfrom_tbl_svy
Design-Based Analysis of Variance and Wald Tests for Survey GLM Fitsget_anova
Survey-Weighted Correlation (Pearson, Polychoric, Polyserial)get_corr
Design-Based Population Covariance for a Survey Designget_covariance
Treatment Effect Estimation for Survey Designsget_diffs
Effective Sample Size for a Survey Designget_effective_n
Weighted Frequency Tables for Categorical Survey Variablesget_freqs
Weighted Mean for a Survey Designget_means
All-Pairs Pairwise T-Tests for Survey Designsget_pairwise
Survey-Weighted Quantilesget_quantiles
Survey-Weighted Ratio Estimationget_ratios
Design-Based Two-Sample T-Test for Survey Designsget_t_test
Weighted Total for a Survey Designget_totals
Design-Based Population Variance for a Survey Designget_variance
GSS 2024: General Social Surveygss_2024
Infer Question Prefaces from Variable Labelsinfer_question_prefaces
Extract Metadata from a Survey Resultmeta meta.survey_result
NHANES 2017-2018: Demographics and Blood Pressurenhanes_2017
Nationscape Wave 1: July 18, 2019ns_wave1
Pew Jewish Americans 2020pew_jewish_2020
Pew NPORS 2025: National Public Opinion Reference Surveypew_npors_2025
Print Method for survey_anova Objectsprint.survey_anova
Print a Survey Diffs Resultprint.survey_diffs
Print method for survey_pairwise objects.print.survey_pairwise
Print a Survey Result Objectprint.survey_result
Print method for survey_t_test objects.print.survey_t_test
Remove Surveys from a 'survey_collection'remove_survey
Extract standard errors from a model or result objectSE
Default SE method: extracts from vcov diagonalSE.default
Extract standard errors from a survey result objectSE.survey_result
Set the Identifier Column on a 'survey_collection'set_collection_id
Set the Missing-Variable Behaviour on a 'survey_collection'set_collection_if_missing_var
Set Direction-of-Improvement Attributeset_higher_is
Set Missing Code(s)set_missing_codes
Set Question Preface(s)set_question_preface
Set Reverse-Coded Flagset_reverse_coded
Set SATA (Select-All-That-Apply) Flagset_sata
Set Universe Description(s)set_universe
Set Value Labelsset_val_labels
Set Variable Label(s)set_var_label
Set Analyst Note(s)set_var_note
Multi-Survey Containersurvey_collection
Access the Data Component of a Survey Design Objectsurvey_data
Fit a Survey-Weighted Generalised Linear Modelsurvey_glm
Survey-Weighted GLM Fit Objectsurvey_glm_fit
Survey Metadata Containersurvey_metadata
Non-probability Samplessurvey_nonprob
Replicate Weights Survey Designsurvey_replicate
Taylor Series Linearization Survey Designsurvey_taylor
Two-Phase Survey Designsurvey_twophase
Extract the Weighting History from a Survey Objectsurvey_weighting_history
Internal Domain Column Name ConstantSURVEYCORE_DOMAIN_COL
Update Design Variables on an Existing Survey Objectupdate_design
Extract variance-covariance matrix from a survey result objectvcov.survey_result