Its possible insert text with stored results after a command, as a putdocx?,:
summarize mpg
putdocx text ("In this dataset, there are ‘r(N)’")
summarize mpg
putdocx text ("In this dataset, there are ‘r(N)’")
asdoc summarize mpg, replace asdoc, text(In this dataset, there are `r(N)')
Record | Car | type | |
1978 | Domestic | Foreign | Total |
1 | 2 | 0 | 2 |
2 | 8 | 0 | 8 |
3 | 27 | 3 | 30 |
4 | 9 | 9 | 18 |
5 | 2 | 9 | 11 |
Total | 48 | 21 | 69 |
ret li scalars: r(N) = 69 r(r) = 2 r(c) = 5
sysuse auto, clear asdoc tab rep78 foreign, replace tab rep78 foreign asdoc, text(In this dataset, there are `r(N)')
asdoc, text(\fs28 \b Table: Tabulation Results) replace asdoc, text(\) asdoc, text(\) asdoc tab rep78, title(\)
sysuse auto, clear asdoc tab rep78 foreign matcell (x) matrix list x mata : st_matrix("x", max(st_matrix("x"))) matrix list x symmetric x[1,1] c1 r1 27
* First to update ssc install asdoc, replace * Load example data webuse hsng2 * Detailed regression table (default option in asdoc) asdoc ivregress 2sls rent pcturban (hsngval = faminc i.region), replace
* nest three regression models
asdoc ivregress 2sls rent pcturban (hsngval = faminc i.region), replace nest
asdoc ivregress 2sls rent pcturban popgrow (hsngval = faminc i.region), nest
asdoc ivregress 2sls rent pcturban popden popgrow (hsngval = faminc i.region), nest
asdoc ivregress 2sls rent pcturban (hsngval = faminc i.region), replace wide
asdoc ivregress 2sls hsng pcturban (hsngval = faminc i.region), wide
asdoc ivregress 2sls pop pcturban (hsngval = faminc i.region), wide
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte firmtype
1
5
5
1
1
5
4
6
7
4
4
1
4
1
4
8
5
4
4
1
end
label values firmtype firmtype
label def firmtype 1 "国有企业", modify
label def firmtype 4 "有限责任公司", modify
label def firmtype 5 "私营企业", modify
label def firmtype 6 "中外合资企业", modify
label def firmtype 7 "外商独资企业", modify
label def firmtype 8 "其他", modify
asdoc tabulate firmtype, replace
Comment