Hi everyone,
I am trying to get summary statistics of my variables using tabstat and would like to export the tables to an excel file. Since there are many variables, I used a loop. However, I want to like the tables for each variable side by side which is not happening. I tried a bunch of options but nothing seems to work out. This the latest code I tried:
eststo clear
local name1_11 "sex_ratio thh hh_memearn illiterate scst_hh lirrigated tpop scpop stpop men women trans working_age"
foreach name1_11 in sex_ratio thh hh_memearn illiterate scst_hh lirrigated tpop ///
scpop stpop men women trans working_age {
eststo `name1_11': estpost tabstat `name1_11', by(cpgender) stat(mean sd)
esttab `name1_11'* using summarystat5.csv, main(mean) aux(sd) coeflabels(0 "Female" 1 "Male") ///
collab(`name1_11') unstack
}
Please help.
Related Posts with Tabstat tables side by side using esttab in a loop
Looping over many valuesDear Statalist, I've came across a problem I couldn't solve. I have a dataset indicting informatio…
inquire about ORDERED LOGISTIC REGRESSIONI am studying people's financial stress. I have a set of 10 items to measure financial stress (1-4 L…
How not to do xtdpdgmmThe title of this post is deliberately provocative: it echoes slides and tweets by Sebastian Kripfga…
Table of same responsesHiii Statalists, I have data with some background variable like name, state and 100 variables v1 v2 …
Merging DataHello all, I have two datasets: one has a column of geographic identifiers and one has a column of …
Subscribe to:
Post Comments (Atom)
0 Response to Tabstat tables side by side using esttab in a loop
Post a Comment