egen Ctry_ID= group(Country IDType) bysort Ctry_ID: asdoc sum Var1Please cite asdoc in your research. In-text citation Tables were created using asdoc, a Stata program written by Shah (2018). Bibliography Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.
Reply To: asdoc: using two variables with bysort for summary statistics
Currently, asdoc allows bysort prefix with only one variable. If you need to use two variables with bysort, then there is a workaround. Convert both the variables to a single with using the group function of egen, and then use the new variable with asdoc. see this example