sinanpl / OaxacaBlinder

R implementation of Oaxaca-Blinder gap decomposition
MIT License
1 stars 1 forks source link

Stata IO functions #26

Closed davidskalinder closed 4 months ago

davidskalinder commented 4 months ago

This PR adds two helper functions to set up tests to be run against results produced in Stata (presumably by Jann's oaxaca command).

Unfortunately, Stata's options for exporting results in a structured way are quite limited (most of formats seem focused on being human-readable), so I've had to add readxl to the Suggests section of DESCRIPTION in order to get the Stata results into R. Of course, these functions are exported, and adding things to Suggests doesn't create a dependency for users, so users shouldn't notice the extra requirement, but it does mean that developers who want to use these functions to get Stata results into R will need readxl.

In theory, we could set up the Stata data in static fixtures without the ability these functions provide to get data in and out (and we could maintain these functions outside of this package). However it seems to me that the ability to easily pass test data back and forth between this package and Stata is especially valuable given the prominence of Jann's implementation, so I think we should include these functions to help keep the test suite robust and easy to use.