First time poster. Apologies for errors. I'm wondering if there's a way to grab the labels along with the pairwise comparisons table? In the code below, I can get the table easily enough but I can't seem to get the labels with it. Ideally, I'd like the matrix to be labeled the same way the actual output is. I have to repeat this many times, however, so it's not feasible to copy and paste directly from Stata's output window into the .rtf created by esttab.

Code:
sysuse auto, clear
foreach var of varlist price mpg rep78 {
     egen `var'dummy = cut(`var'), group(2)
     label def `var'dummy 0 "Below Avg. `var'" 1 "Above Avg. `var'"
     label val `var'dummy `var'dummy
}
logit pricedummy i.mpgdummy##i.rep78dummy headroom trunk weight
margins mpgdummy##rep78dummy, pwcompare(pv) atmeans post
matselrc r(table_vs) a, r(1 2 4)
mat li a
esttab mat(a, transpose fmt(%9.2f)) using pwdiffs.rtf, replace