Dear all,

I am trying to do some simple mean summary statistics for each variable with panel data (individual,year), but I fail to get the N(overall obs.) and n (number of clusters/individuals/groups) by ethnic groups (f1, f2, f4, etc.).
The variable native includes all ethnicities plus the native workers. I want to leave out native workers for now, that's why I have the if condition.
This is what I do:
Code:
global summary1 rhw pexpuk pexpabroad edu1_ edu2_ edu3_ edu4_ edu5_ edu6_ edu7_ edu8_ fd_ first_  region7_  region6_ region8_ region2_ 
bysort native: xtsum $summary1 if f1==1 | f2==1 | f4==1 | f6==1 | f8==1 | f10==1 | f12==1 | f14==1
estpost tabstat $summary1 if f1==1 | f2==1 | f4==1 | f6==1 | f8==1 | f10==1 | f12==1 | f14==1, by(native) stat(mean n N) columns(statistics) 
esttab . using $graphs_tables/table2_.tex, main(mean %12.1fc) not nostar unstack nomtitle nonumber nonote label replace stats(n N, fmt(%9.0f) labels(Individuals Observations))
The above code runs without errors, but I get only N reported once. I would like to have for each ethnicity column N and n at the bottom. E.g.:
ethnicity f1 f2 f4 f6 f8 f10 f12 f14
rhw
pexpuk
.
.
.
.
n
N

When I do:
Code:
ereturn list
the number of clusters/individuals/groups is not reported, so it makes sense that I do not get those numbers.
I am wondering, which Stata commands to use to obtain the above table structure.

Thanks a lot for your help,

Nico