I want to know to import the tabstat results to a stata data editor. I am using the following programming to generate the tables:
clear
use http://www.stata-press.com/data/r7/emd.dta
egen year = seq(), f(2000) t(2017) b(50)
egen employment = seq(), f(0) t(1)
egen woman = seq(), f(0) t(1) b(3)
tabstat income_pc ln_rsales_pc if (employment==1 & woman==1) , by(year) stat(mean)
year | income~c | ln_rsa~c |
2000 | 7020,25 | 1,259833 |
2001 | 7341,647 | 1,337832 |
2002 | 8144,588 | 1,429708 |
2003 | 8452,750 | 1,337236 |
2004 | 7672,235 | 1,137432 |
2005 | 6337,529 | 1,45094 |
2006 | 7443,063 | 1,445514 |
2007 | 7205,059 | 1,212824 |
2008 | 7349,176 | 1,537873 |
2009 | 7169,813 | 1,190784 |
2010 | 7685,588 | 1,442450 |
2011 | 8039,471 | 1,362596 |
2012 | 7831,688 | 1,361909 |
2013 | 7842,118 | 1,615033 |
2014 | 7456,882 | 1,387460 |
2015 | 8972,063 | 1,477648 |
2016 | 8430,824 | 1,249506 |
2017 | 7672,813 | 1,519410 |
Total | 7667,512 | 1,385751 |
tabstat income_pc ln_rsales_pc if (employment==1 & woman==0) , by(year) stat(mean)
year | income~c | ln_rsa~c |
2000 | 6.301 | 1,322263 |
2001 | 8792,25 | 1,517516 |
2002 | 8533,375 | 1,588966 |
2003 | 6377,222 | 1,549586 |
2004 | 7743,5 | 1,373349 |
2005 | 8216,625 | 1,44328 |
2006 | 8094,667 | 1,433068 |
2007 | 7761,875 | 1,630231 |
2008 | 7070,25 | 1,322427 |
2009 | 7050889 | 1,65083 |
2010 | 7644,5 | 1,472512 |
2011 | 6858,25 | 1,528995 |
2012 | 7274,333 | 1,268808 |
2013 | 7547,375 | 1,632361 |
2014 | 7931,75 | 1,371934 |
2015 | 7218,667 | 1,388987 |
2016 | 8817,125 | 1,682204 |
2017 | 7312,5 | 1,401294 |
Total | 7564,567 | 1,479048 |
I would like the union of the two tables are in a stata database, it woud be something like that in the database:
year | income~c | ln_rsa~c | income~c | ln_rsa~c |
2000 | 7020,25 | 1,259833 | 6.301 | 1,322263 |
2001 | 7341,647 | 1,337832 | 8792,25 | 1,517516 |
2002 | 8144,588 | 1,429708 | 8533,375 | 1,588966 |
2003 | 8452,750 | 1,337236 | 6377,222 | 1,549586 |
2004 | 7672,235 | 1,137432 | 7743,5 | 1,373349 |
2005 | 6337,529 | 1,45094 | 8216,625 | 1,44328 |
2006 | 7443,063 | 1,445514 | 8094,667 | 1,433068 |
2007 | 7205,059 | 1,212824 | 7761,875 | 1,630231 |
2008 | 7349,176 | 1,537873 | 7070,25 | 1,322427 |
2009 | 7169,813 | 1,190784 | 7050889 | 1,65083 |
2010 | 7685,588 | 1,442450 | 7644,5 | 1,472512 |
2011 | 8039,471 | 1,362596 | 6858,25 | 1,528995 |
2012 | 7831,688 | 1,361909 | 7274,333 | 1,268808 |
2013 | 7842,118 | 1,615033 | 7547,375 | 1,632361 |
2014 | 7456,882 | 1,387460 | 7931,75 | 1,371934 |
2015 | 8972,063 | 1,477648 | 7218,667 | 1,388987 |
2016 | 8430,824 | 1,249506 | 8817,125 | 1,682204 |
2017 | 7672,813 | 1,519410 | 7312,5 | 1,401294 |
Total | 7667,512 | 1,385751 | 7564,567 | 1,479048 |
Thanks for your helping.
0 Response to How to import tabstat results to data editor?
Post a Comment