搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  连玉君-ttable3.rar
资料下载链接地址: https://bbs.pinggu.org/a-1449709.html
附件大小:


ttable3 命令使用说明简介:

The official command ttest tests that a single variable has the same mean within thetwo 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-testsysuse auto,clearttable3 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.26weight 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) medianNonparametric equality-of-medians test--------------------------------------------------------------------------Variables G1(Domestic)Median1 G2(Foreign)Median2 Chi2--------------------------------------------------------------------------price 52 4782.500 22 5759.000 2.329weight 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-groupstab rep78ttable3 price wei len mpg if rep78==3|rep78==4, by(rep78)使用方法:
  • 请将 ttable3.dottable3.sthlp 放置于 【stata15\ado\base\t】 文件夹下;
  • 输入 help ttable3 可以查看帮助文件;

程序尚不完善,欢迎提出修改建议:连玉君,E-mail: arlionn@163.com , 主页:https://www.lianxh.cn

相关程序连接:程序下载:







  • FAQs:

    Q1: 请问如果做单个变量的均值比较,该变量可能又可划分为多种情况的,怎么自动生成?

    例如,连老师举的例子中,我要看不同 rep78price 的显著性,rep78 有 5 个类型。有的时候可能会有 30 种,比如各省的显著性,这个时候一个个去做就麻烦,而且会出错。

    sysuse auto,clearbyrep78: ttest price=6000byrep78: ttest price=0
    • Reply: 这种情况下,你可以使用 ttestplus 命令,完全符合你的要求。

    Q2: 只能在 Stata12 中使用吗?较低点的版本行吗?

    • Reply: 我在程序种设定的是 stata10,你可以修改成更低的版本号。

    Q3: 可以在输出组间均值差异的同时,输出 t-value 或 p-value 吗?

    • Reply: ttable3 命令没有这个功能,但可以用外部命令 normdiff, 它的功能更强大,也更灵活。




    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

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

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

GMT+8, 2025-12-27 03:33