Supplemental Code Examples
This section provides key updates to software for analysis of survey data.
Slides and R/STAN code from Presentation “Pseudo-Bayesian Inference for Complex Survey Data”, April 2020, Matt Williams and Terrance Savitsky. Link to Slides Link to R/STAN Code
Discussion of R Packages for Survey Data Analysis “srvyr compared to the survey package” by Greg Freedman, 2022-02-20. Link to Discussion, Examples and Code
Working Version of R Code for Archer and Lemeshow GOF test, Developed by Yajuan Si and Kevin Pritchard with assistance from Brady West, University of Michigan, July 16 2022. Link to R Code
Weight Calibration across Packages, Presentation by Stas Kolenikov, 9/23/2019. Link to Presentation
ASDA3 Chapter 11 Veiga Example: ASDA3 Chapter 11-Example of Veiga Approach
Djalma Pessoa [aut], Anthony Damico [aut, cre], Guilherme Jacob [aut], “R convey: Income Concentration Analysis with Complex Survey Samples”, January 2024
Link to R Convey Package
Link to Paper “Poverty and Inequality with Complex Survey Data”
Lumley, Thomas, Description and Link to R package for mixed models under complex sampling Link to Paper
Steven G Heeringa PhD, Patricia A Berglund MBA, Brady T West PhD, Edmundo R Mellipilan MS, Kenneth Portier PhD,
“Attributable fraction estimation from complex sample survey data”, Annals of Epidemiology Volume 25, Issue 3, March 2015, Pages 174-178
Link to Paper with R code
Link to SAS Code
R-Example of Quantile Regression with Bootstrap Method: R Quantile Regression Example
Stata Example of Mediation analysis with survey data and subpopulation indicator: Stata sgmediation example
Link to Stata command for calculation of Population Attributable Risk proportions (user written “punaf” command):
https://www.imperial.ac.uk/nhli/r.newson/usergp/uk2012/newson_ohp1.pdf
SAS-Example of how to use replicate weights using NHANES data: SAS Replicate Weights Example
SAS-Example of use of NOMCAR option with PROC SURVEYMEANS: SAS NOMCAR Example
Example of How to Create a Delimited Text File in SAS and Read Text File in R: Text File SAS to R Example
Paper about implementation of the Wilcoxon rank sum test for complex sample survey data: Link to Paper
SAS Paper with Examples of ODS Graphics and SG Procedures with Examples of Weighted Frequency Plots: SAS Paper with ODS Graphics and SG Procedures Examples
Note on How SPSS handles Strata with A Single or “Lonely” PSU:https://www-01.ibm.com/support/docview.wss?uid=swg21479202
Example of using PROC EXPORT to convert SAS data set to Stata (.dta) and SPSS (.sav): SAS PROC EXPORT Example
Multiple Imputation Using the Fully Conditional Specification Method: A Comparison of SAS, Stata, IVEware, and R:Link to Presentation
Analysis of Survey Data Using the SAS SURVEY Procedures: A Primer: Link to Presentation
Mplus Notes area with many articles about survey data analysis: https://statmodel.com/resrchpap.shtml
Presentation on AIC and BIC for Survey Data by Thomas Lumley and Alastair Scott: Link to Presentation