Longitudinal Analysis Guide

Panel Data Stata R PDF Data Analysis

Attention Stata users! Our blog series covering the first two phases of PMA panel data is now available in PDF format, with separate versions featuring examples in both R and Stata.

Matt Gunther (IPUMS PMA Senior Data Analyst)

Thanks to contributions from our friends at Biostat Global Consulting, IPUMS PMA is pleased to announce that we’ve released a PDF version of our blog series on PMA panel data adapted for Stata users. We’ve also reformatted the original R examples for readers who prefer a PDF.

You can find both versions of the PMA Longitudinal Analysis Guide below, or on our GitHub Page. If you’d like, you can also download a .do file containing all of the code featured in the Stata version (additional helper files are available here). R users can download an R Markdown file containing the full PDF text with embedded, executable R code.

Guide for Stata Users

Guide for R Users

How We Built This

If you visit our GitHub Page, you’ll notice two R Markdown files: one for the R version of this guide, and - perhaps surprisingly - one for the Stata version! Although we weren’t quite able to elegantly execute Stata code with R Markdown, building both documents with the same toolkit allowed us to create “twin” versions with a single set of layout options. Additionally, we were able to use hidden inline R functions in both documents that, for example, automatically style hyperlinks for IPUMS variables in R (UPPERCASE) and Stata (lowercase). Check out our utilities script on GitHub if you’d like to peek under the hood at these inline tools.

Huge thanks to the authors of pagedown, an R package that uses the Page.js JavaScript library to paginate HTML content for PDF printing. If you’re someone who has already put a lot of thought into CSS for an website or blog, and you’re wondering if there’s an easy way to port your style guide to a book (without LaTeX) - this is it!


If you see mistakes or want to suggest changes, please create an issue on the source repository.