tabulate, table 都没有扩大变量label字符数的选项。我用statsby保留变量的长label,但是生成的频数表是new data set.
. clear
. set obs 200
obs was 0, now 200
. gen x= int(14*runiform() + 1)
.
. label define l_x 1 "ok" 2 "okok" 3 "okokok"
. label define l_x 11 "Adminstr. and Support and Waste Mangment and Remediation Serv.",add
. label value x l_x
.
. tabulate x
x | Freq. Percent Cum.
----------------------------------------+-----------------------------------
ok | 15 7.50 7.50
okok | 14 7.00 14.50
okokok | 12 6.00 20.50
4 | 15 7.50 28.00
5 | 8 4.00 32.00
6 | 16 8.00 40.00
7 | 13 6.50 46.50
8 | 12 6.00 52.50
9 | 17 8.50 61.00
10 | 14 7.00 68.00
Adminstr. and Support and Waste Mangmen | 19 9.50 77.50
12 | 14 7.00 84.50
13 | 18 9.00 93.50
14 | 13 6.50 100.00
----------------------------------------+-----------------------------------
Total | 200 100.00
.
. gen n=x
. statsby freq=r(N), by(x) clear: tab n
(running tabulate on estimation sample)
command: tabulate n
freq: r(N)
by: x
Statsby groups
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
..............
. l
+-----------------------------------------------------------------------+
| x freq |
|-----------------------------------------------------------------------|
1. | ok 15 |
2. | okok 14 |
3. | okokok 12 |
4. | 4 15 |
5. | 5 8 |
|-----------------------------------------------------------------------|
6. | 6 16 |
7. | 7 13 |
8. | 8 12 |
9. | 9 17 |
10. | 10 14 |
|-----------------------------------------------------------------------|
11. | Adminstr. and Support and Waste Mangment and Remediation Serv. 19 |
12. | 12 14 |
13. | 13 18 |
14. | 14 13 |
+-----------------------------------------------------------------------+