I'm trying to create a custom table with some specific stats, namely, I want to see how many observations are missing and how many are from the a particular country. I want to do this for five variables: paddy, coffee, millet, tea and indigo. My code is as follows:
Code:
foreach x in paddy coffee millet tea indigo { count if country==74 // 74 is the relevant country code estadd local n_country `r(N)' count if missing(`var') estadd local n_missing `r(N)' est store `x' } esttab paddy coffee millet tea indigo using "table.tex", noabbrev tex replace /// stats(n_country n_missing, labels("Country" "Missing")) /// nonote title("Study Sample Size")
Please could someone tell me what is the issue here? Thank you!
0 Response to Adding custom stats in a table
Post a Comment