Table of Differences in Means Tests / Tabla de Tests de Diferencias de Medias
español In this post I leave you a simple Stata code that generates a table of means differences (between 2 groups) for a set of variables. It looks like this: A table of this type will be useful, for example, when the aim is to compare a treatment group and a control group across a series of variables. Stata has the ttest command to perform tests of this kind, but does not incorporate, as far as I know, a functionality for exporting a table of multiple tests. This code tests a large number of variables, with the advantage that it generates and exports a publication-style table. The table is saved in a text (.txt) file. Then, I usually import this table into Excel (insert> data> text) for final retouching before copying it to the final document. I leave you the Excel template as well. For simplicity, asterisks for significant statistics, parentheses and brackets are added – also automatically – by the Excel template. From the statistical point of view, it might be worth mentioning the subject of false-discovery rates, which could be relevant in an application of this type. I will leave it for for a future post. You can test the code…