全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
5186 2
2012-12-04
在一个数据中,变量sector是分类变量,取值为1~15,并且已经对values添加了label,其中一个取值(11)的label字符数比较长,在命令窗口输入:. tabulate sector


得到的频数表中,sector列(第一列)第11行显示的值标签总是缺一部分字符,比如该值标签为:
Adminstr. and Support and Waste Mangment and Remediation Serv.

在列表中总是无法完整显示,但是在Stata的结果窗口中,整个频数表的右侧距离结果窗口的界面右端还有足够的距离。

故此向各位坛友咨询,在不删减值标签中字符的前提下,如何能够让生成的频数表完整显示值标签?
或者说有什么方法能够让sector所在列的字符占位扩大?

                                        sector |      Freq.     Percent        Cum.                                         (竖线代表结果窗口的右边界)
----------------------------------------+--------------------------------------                                            |

                                                                                                                                                |
                                                                                                                                                |
                                                                                                                                                |
                                                                                                                                                |
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-12-4 07:27:19
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 |
     +-----------------------------------------------------------------------+
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-4 16:55:47
大白菜2012 发表于 2012-12-4 07:27
tabulate, table 都没有扩大变量label字符数的选项。我用statsby保留变量的长label,但是生成的频数表是new ...
多谢啦!正在学习你的回帖
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群