I have a seemingly simple question that I find no good solution to.
I am creating a table in stata running a command that looks like this:
and I want to send the table that is displayed in the results window toa csv-file, so that when I change something in the data and run the command again, I don's have to manually change all the numbers or copy-and-paste and format everything again. Surprisingly, I cannot find a way to do this in a convenient way. The closest fit was created using logfile,
but that creates a table in csv where I have to manually reformat a lot. I have also unsuccessfully tried using tabout, estout, putdocx and putexcel. The main problem seems to be that table doesn't save any information other than the number of observations in r(), so it seems impossible to extract the information I want and write it to a csv file.
Maybe someone had this problem already and found a good solution? Any advice would be highly appreciated.
I am creating a table in stata running a command that looks like this:
Code:
table var1 var2 [pw=weight], statistic(mean var3) nformat(%8.3g) statistic(freq)
Code:
cd "$OUT" logout, save("test.csv") excel replace: table var1 var2 [pw=weight], contents(mean var3 freq)
Maybe someone had this problem already and found a good solution? Any advice would be highly appreciated.
Comment