worldbank / ietoolkit

Stata commands designed for Impact Evaluations in particular, but also data work in general
https://worldbank.github.io/ietoolkit/
MIT License
214 stars 75 forks source link

iebaltab: add option for randomization inference p-values #195

Open luizaandrade opened 5 years ago

luizaandrade commented 5 years ago

Currently, iebaltab reports means differences and significance level based on p values from a t-test. I have received two separate requests (on the same day, so maybe strategically coordinated) to include an option to report p-values based on randomized inference.

It's possible that this would take writing a whole randomization inference command, but this is something to keep in mind while rewriting iebaltab. In particular, I'm thinking there may be a way to add an extra column of pre-stored locals from a different command.

MRuzzante commented 5 years ago

I deny the existence of a conspiracy against you, @luizaandrade! :stuck_out_tongue_winking_eye:

I momentarily solved the issue by separately computing the randomization inference (RI) p-values before running iebaltab. Namely, I used the command ritest and then stored these p-values in a matrix.

Therefore, instead of directly outputting the LaTeX file from iebaltab, I used the option browse to get the estimates in Stata, and then attach a new column with the RI p-values from the matrix above.

Finally, I wrote the LaTeX table with file read mimicking what is done in iebaltab.