data(medicaid) # then use the object `medicaid`
data(signflip)Bundled datasets
Both packages ship the example datasets used in the paper and vignettes. In R they are lazy-loaded data objects; in Stata they are loaded with stacked use.
R data(medicaid) ↔︎ Stata stacked use medicaid
Usage
stacked use medicaid, clear
stacked use signflip, clearstacked use finds the bundled .dta from data/, the current directory, then the adopath. After a net install, fetch them once with net get stacked. The clear option replaces the data in memory.
Datasets
| Name | Rows | Description | R | Stata |
|---|---|---|---|---|
medicaid |
714 | State-year ACA Medicaid expansion panel; outcome uninsured. The paper’s headline example. |
yes | yes |
smoke |
10,615 | County-day smoke-plume / PM2.5 panel (2016); Date-keyed adoption. |
yes | yes |
acs_micro |
69,820 | 0.3% ACS microdata sample; repeated cross-section, survey weight perwt, covariates. |
yes | yes |
signflip |
72 | Deterministic 12-unit teaching panel where naive TWFE flips the sign; Q-weights recover +2.4. | yes | yes |
unparallel |
120 | Deterministic teaching panel with a differential pre-trend (parallel-trends violation). | yes | yes |
pscore_stack |
— | A pre-built stack with an estimated score phat, for the pscore demo. |
— | Stata only |
pscore_stack exists only in the Stata package (it cross-checks the pscore weights against an R-simulated golden stack); in R, build a stack and estimate the score inline as shown on the pscore page.
R ↔︎ Stata mapping
| R | Stata |
|---|---|
data(medicaid) |
stacked use medicaid, clear |
data(smoke) |
stacked use smoke, clear |
data(acs_micro) |
stacked use acs_micro, clear |
data(signflip) |
stacked use signflip, clear |
data(unparallel) |
stacked use unparallel, clear |
| (build inline) | stacked use pscore_stack, clear |
Example
library(stacked)
data(medicaid)
str(medicaid)Classes 'data.table' and 'data.frame': 714 obs. of 5 variables:
$ state : chr "AL" "AL" "AL" "AL" ...
$ statefip : int 1 1 1 1 1 1 1 1 1 1 ...
$ year : int 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 ...
$ adopt_year: int NA NA NA NA NA NA NA NA NA NA ...
$ uninsured : num 0.196 0.214 0.23 0.225 0.216 ...
- attr(*, ".internal.selfref")=<externalptr>
head(medicaid) state statefip year adopt_year uninsured
1: AL 1 2008 NA 0.1964095
2: AL 1 2009 NA 0.2141095
3: AL 1 2010 NA 0.2300015
4: AL 1 2011 NA 0.2250678
5: AL 1 2012 NA 0.2159348
6: AL 1 2013 NA 0.2218695
stacked use medicaid, clear
describe
list in 1/6See also
build_stack()/stacked build— build a stack from one of these- Data section — per-dataset detail pages
- Applied-example vignette