全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 经管代码库
45358 82
2015-02-15

代码解释ttable3命令使用说明+相关程序+使用方法+程序下载+FAQ




1、ttable3 命令使用说明





简介:
The official command -ttest- tests that a single variable has the same mean within the two groups defined by groupvar, while another official command -median- do similar things for group medians.  -ttable3- performs ttest for a group of variables specified in varlist with formatted table output. When median option is specified, it performs median test.

范例:
       * t-test
         sysuse auto,clear
         ttable3 price wei len mpg, by(foreign)
         ttable3 price wei len mpg, by(foreign) f(%8.2f)


Two-sample t test with equal variances
--------------------------------------------------------------------------
Variables   G1(Domestic)     Mean1     G2(Foreign)    Mean2      MeanDiff
--------------------------------------------------------------------------
price         52            6072.42       22         6384.68    -312.26
weight        52            3317.12       22         2315.91    1001.21***
length        52             196.13       22          168.55      27.59***
mpg           52              19.83       22           24.77      -4.95***
--------------------------------------------------------------------------

       * Median test
         ttable3 price wei len mpg, by(foreign) median




Nonparametric equality-of-medians test
--------------------------------------------------------------------------
Variables   G1(Domestic)  Median1      G2(Foreign)  Median2      Chi2
--------------------------------------------------------------------------
price         52        4782.500         22      5759.000       2.329
weight        52        3360.000         22      2180.000      25.874***
length        52         200.000         22       170.000      25.874***
mpg           52          19.000         22        24.500      10.268***
--------------------------------------------------------------------------

       * Restrict to two-groups
         tab rep78
         ttable3 price wei len mpg if rep78==3|rep78==4, by(rep78)

2、使用方法





   1. 请将 ttable3.do 和 ttable3.sthlp 放置于 stata12\ado\base\t 文件夹下;
   2. 输入 help ttable3 可以查看帮助文件;
   程序尚不完善,欢迎提出修改建议:连玉君,E-mail:
arlionn@163.com




3、相关程序连接:




   -hausmanxt-    基于 Bootstrap 的 Hausman 检验命令   
https://bbs.pinggu.org/thread-2763156-1-1.html
   -hhi5-         生成赫芬达尔指数的Stata命令                  https://bbs.pinggu.org/thread-2764997-1-1.html
     -ttable3-           组间均值和中位数差异检验列表命令         https://bbs.pinggu.org/thread-2765062-1-1.html
    -winsor2-          一次性对多个变量执行 winsor 缩尾处理     
https://bbs.pinggu.org/thread-2807843-1-1.html




4、程序下载:



( 点击 -ttable3- 多变量组间均值和中位数差异检验列表命令


5、FAQ:



  • Q1: 请问如果做单个变量的均值比较,该变量可能又可划分为多种情况的,怎么自动生成?
    例如连老师举的例子中,我要看不同rep78的price的显著性,rep78有5中类型。有的时候可能会有30种,比如各省的显著性,这个时候一个个去做就麻烦,而且会出错。
    sysuse auto,clear
    by  rep78: ttest price=6000
    by  rep78: ttest price=0
    Reply:这种情况下,你可以使用 -ttestplus- 命令,完全符合你的要求。


  • Q2: 只能在stata12中使用吗?较低点的版本行吗?
  • Reply:我在程序种设定的是 stata10,你可以修改成更低的版本号。

  • Q3: 可以在输出组间均值差异的同时,输出 t-value 或 p-value 吗?
  • Reply: -ttable3- 命令没有这个功能,但可以用外部命令 -normdiff-, 它的功能更强大,也更灵活。



二维码

扫码加我 拉你入群

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

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

全部回复
2015-2-15 20:17:49
借位置发个帖下年鉴http://nianjian.******/tags.php?/%E4%B8%AD%E5%9B%BD%E5%86%9C%E6%9D%91%E7%BB%9F%E8%AE%A1%E5%B9%B4%E9%89%B4%E4%B8%8B%E5%9C%B0%E8%BD%BD/1/13424002503/
二维码

扫码加我 拉你入群

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

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

2015-4-17 23:44:04
连老师,您好。您的视频看了,但是做双边随机前沿分析时总是不收敛,您能不能解答一下?还有,您近期还有没有开班的打算啊?谢谢连老师。
二维码

扫码加我 拉你入群

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

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

2015-4-19 12:12:18
强大,就是自己编程。。。。
二维码

扫码加我 拉你入群

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

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

2015-4-27 10:23:49
这个得慢慢学习了非常谢谢楼主的指导
二维码

扫码加我 拉你入群

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

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

2015-4-29 23:58:28
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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