全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
5107 6
2013-04-19
悬赏 500 个论坛币 已解决
正在做一个test:有关比较两组数中位数是否相等

google了发现cendif命令可以做,http://www.stata.com/statalist/archive/2002-07/msg00118.html

但是运行help里面的例子

webuse auto.dta,clear
cendif weight, tdist by(foreign)

发现下面的错误信息:option cfweight() not allowed,参看帮助文件,cfweight()确实是option之一,但是我上面的例子根本没用,为什么会有出错信息???

非常感谢!

或者有其他比较两组数中位数是否相等的命令吗?

最佳答案

arlionn 查看完整内容

需要下载最新的版本,下载方法如下: net install snp15_7.pkg, replace 检查无误: . sysuse auto, clear (1978 Automobile Data) . cendif weight,by(foreign) Y-variable: weight (Weight (lbs.)) Grouped by: foreign (Car type) Group numbers: Car type | Freq. Percent Cum. ------------+----------------------------------- Domestic | 52 70.27 70.27 ...
二维码

扫码加我 拉你入群

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

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

全部回复
2013-4-19 17:29:09
需要下载最新的版本,下载方法如下:
net install snp15_7.pkg, replace

检查无误:
. sysuse auto, clear
(1978 Automobile Data)

. cendif weight,by(foreign)
Y-variable: weight (Weight (lbs.))
Grouped by: foreign (Car type)
Group numbers:

   Car type |      Freq.     Percent        Cum.
------------+-----------------------------------
   Domestic |         52       70.27       70.27
    Foreign |         22       29.73      100.00
------------+-----------------------------------
      Total |         74      100.00
Transformation: Fisher's z
95% confidence interval(s) for percentile difference(s)
between values of weight in first and second groups:
   Percent    Pctl_Dif     Minimum     Maximum
        50        1095         750        1330
二维码

扫码加我 拉你入群

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

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

2013-4-19 18:56:29
arlionn 发表于 2013-4-19 17:48
需要下载最新的版本,下载方法如下:
net install snp15_7.pkg, replace
非常感谢!

我用的是stata11,运行net install snp15_7.pkg, replace
出现下面的出错信息
. net install snp15_7.pkg, replace
file http://www.stata.com/snp15_7.pkg not found
server says file temporarily redirected to http://www.stata.com/error/404.html
could not load snp15_7.pkg from http://www.stata.com/

另外从,结果的解读上看,看不出来到底是Domestic group还是Foreign group的median比较大?怎么没有明确的p value之类的。

二维码

扫码加我 拉你入群

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

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

2013-4-19 18:57:11
arlionn 发表于 2013-4-19 17:48
需要下载最新的版本,下载方法如下:
net install snp15_7.pkg, replace
用median 命令可以解决问题吗?用了一下这个命令,根据结果,好像只能知道两个group的中位数是否不同,并没有报告各组的中位数,靠谱不?
二维码

扫码加我 拉你入群

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

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

2013-4-19 21:12:04
econfj 发表于 2013-4-19 18:56
非常感谢!

我用的是stata11,运行net install snp15_7.pkg, replace
应该需要stata12,我的也是stata11,结果给出以下提示:
this is version 11.0 of Stata; it cannot run version 12.0 programs
You can purchase the latest version of Stata by visiting http://www.stata.com.
二维码

扫码加我 拉你入群

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

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

2013-4-20 01:33:45
. clear

. version
version 11.2

. sysuse auto
(1978 Automobile Data)

. cendif weight,by(foreign)
Y-variable: weight (Weight (lbs.))
Grouped by: foreign (Car type)
Group numbers:

   Car type |      Freq.     Percent        Cum.
------------+-----------------------------------
   Domestic |         52       70.27       70.27
    Foreign |         22       29.73      100.00
------------+-----------------------------------
      Total |         74      100.00
Transformation: Fisher's z
95% confidence interval(s) for percentile difference(s)
between values of weight in first and second groups:
   Percent    Pctl_Dif     Minimum     Maximum
        50        1095         750        1330




没有问题
stata11可以用
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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