[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: display single value stored in e()

From   "Eric A. Booth" <>
Subject   st: display single value stored in e()
Date   Tue, 19 May 2009 14:45:48 -0500


I am trying to figure out how to display one value from a e() matrix/ scalar/etc. in the footnote of a esttab table.

For instance, if I run the commands below, I would like the addnotes("") command to display the weighted number of missing values ( e(count) ) from the -estpost svy: tabulate- above. I realize that including "missing" as a option for the -estpost svy: tabulate- command would display the weighted count in the -esttab- table, but I don't want the weighted count in the main needs to lie in the notes under the table. Any ideas?

webuse nhanes2b, clear
//create missing
gen random = uniform()*100
replace sex = . if random<25
recode sex (.=.a)
//label variables
label def sex 0 "Female", modify
label def sex 1 "Male", modify
label def sex .a "MISSING", modify
label val sex sex

svyset psuid [pweight=weight], strata(stratid)
estpost svy: tabulate sex,  count obs  se

esttab  using "`sourcefiles'weighted.csv", ///
cell(" count obs se cell") varlabels(`e(labels)') csv ///
addnotes(" `e(count)' ") replace



Eric A. Booth
Public Policy Research Institute
Texas A&M University
Office: +979.845.6754

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index