Replication code for "Latent Dirichlet Analysis of Categorical Survey Data"
Author: Evan Munro and Serena Ng
This repository contains data and code for a working paper with Serena Ng.
It contains three folders:
- Raw data and associated description files in text format for Michigan data
- Recoded Card data in RData format and description files in text format
- README with sources and data guide
posteriorsContains saved model posterior means that are used to create the tables for the paper
mcmc_simulations.Rfor the simulations recorded in Table 1 in the paper
And some scripts:
utils.Rcontain utility functions for plotting data
dhs_analysis.Rproduce tables and figures for the application section of the paper, either from the saved model posteriors or from a newly estimated model. Set
re-estimate=Tin order to re-estimate the models (can be computationally intensive).
It is is necessary to install the R package dhlvm for the models in the paper from Github using the R package
The scripts also require the following R packages, which are available on CRAN:
MCMCpack, reshape2, ggplot2