Here are little chunks of R code to quickly access survey datasets. Some of the linked datasets are provided on an "as-is" basis: typically, you might want to check the official ANES files rather than rely on the extracts linked to below. This also applies to data extracts bundled in packages.
The code occasionally calls the download
and foreign
packages, respectively to get files from HTTPS sources and to deal with foreign formats. The Gelman and Hill replication also uses plyr
and ggplot2
, but check the original code for identical functions written in base R.
- Anthony J. Damico's
usgsd
repository of scripts for survey microdata analysis; ref.; how it compares - Andrew Heiss' extension of Amaney Jamal and Mark Tessler's Arab Barometer analysis (ICPSR data)
- Zack M. Alquist's R packages of the U.S. Census; compare with
- Jason Bryer and Przemyslaw Biecek's PISA survey packages; compare with
- Ezra Haber Glenn's R package for the ACS; compare with; ref
- Peter Naderer's survey of Chechen Youth; ref.
- CRAN Task Views on social sciences, official stats and reproducible research
- R packages to work with survey data
- example datasets in the OIdata package
Stata survey code on Github:
- Neal Caren's NFSS analysis in Stata (ICPSR data); ref.
- Michael Bishop's repository for AddHealth with Stata (compare with)
There's also a Python example with NFGS data in Think Stats.
- Same list for country-level data, using the
onlineData
tag at CRANtastic (FAOSTAT
,Quandl
,rdatamarket
WDI
, etc.).