ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:29.08KB ,
资源ID:11577253      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/11577253.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(有序分类资料的统计分析Stata实现.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

有序分类资料的统计分析Stata实现.docx

1、有序分类资料的统计分析Stata实现第十二章有序分类资料的统计分析的Stata实现本章使用的STATA命令:列变量有序时的分类资料CMH卡方分析opartchi 行变量 weight, by(列变量)(见Stata7附加程序)双向有序时的Spearman相关spearman 变量1 变量2例12-2 某研究欲观察人参的镇静作用,选取32只同批次的小白鼠,将其中20只随机分配到人参组:以5%人参浸液对其做腹腔注射,12只分配到对照组:以等量蒸馏水对其做同样注射。实验结果如表12-2所示。能否说明人参有镇静作用?表12-2 人参镇静作用的实验结果镇静等级人参组对照组- 411 1 0+ 2 1+

2、1 0+12 0 1建立检验假设,确定检验水准。:人参没有镇静作用(样本来自两个相同总体):人参有镇静作用(样本来自两个不同总体) Stata数据为:abx11412113214115122111220231240250Stata命令为:opartchi b weight=x,by(a)结果为: Chi-square tests df Chi-square P-value Independence 4 16.64 0.0023 - Components of independence test Location 1 15.29 0.0001 Dispersion 1 .3496 0.5543

3、在的水平上,拒绝,接受H1,认为两总体之间的差别有统计学意义,可以认为人参组和对照组镇静等级的差别有统计学意义,人参有镇静作用。例12-3 试根据表12-4的资料,检验针刺不同穴位的镇痛效果有无差别? 表12-4 针刺不同穴位的镇痛效果穴位镇痛效果合谷38441224足三里53292816扶突47231933 1建立检验假设,确定检验水准。:三个穴位的镇痛效果相同:三个穴位的镇痛效果不全相同Stata数据为:groupeffectw113812441312142421532229232824163147322333193433Stata命令为:opartchi effect weight=w,

4、by(group)结果为: Chi-square tests df Chi-square P-value Independence 6 22.07 0.0012 - Components of independence test Location 2 3.118 0.2103 Dispersion 2 5.914 0.0520 有。在的水平上尚不能拒绝,即根据本例资料尚不能认为针刺不同穴位的镇痛效果差别有统计学意义。例12-4 两名放射科医师对13张肺部X线片各自做出评定,评定方法是将X线片按病情严重程度给出等级,结果如表12-6所示。问他们的评定结果是否相关。表12-6 两名放射科医师对13

5、张肺部X片的评定结果X片编号12345678910111213甲医师X+ +乙医师Y + +1建立检验假设,确定检验水准。:0(两名医师的等级评定结果不相关):(两名医师的等级评定结果相关)Stata数据为:ixy1212333024125006237348439341044110112331323Stata命令为:spearman y x结果为:Number of obs = 13Spearmans rho = 0.8082Test of Ho: y and x are independent Prob |t| = 0.0008Pchi2 = 0.1027Chi2(1) for trend

6、= 4.546, prchi2 = 0.0330Chi2(1) for departure = 0.004, prchi2 = 0.9467The “Chi2(1) for trend” is slightly different. Its 4.546 rather than 4.515. Well, ptrend is just using N rather than N 1 in the formula: Qtrend = Chi2(1) for trend = N * ray2Lets go back to data arranged for the corr computation a

7、nd show this. . quietly corr y a fw=weight . display r(N)*r(rho)24.5464579Qtrend is just Pearsons correlation again. A regression is performed here to compute the slope, and the test of slope = 0 is given by the Qtrend statistic. Well, we all know the relationship between Pearsons correlation and re

8、gressionthis is all this is. Qdeparture (=Chi2(1) for departure as Roystons output nicely labels it) is the statistic for the CochranArmitage test. But Qtrend and Qdeparture are usually performed at the same time, so lumping them together under the name “CochranArmitage” is sometimes loosely done. T

9、he null hypothesis for the CochranArmitage test is that the trend is linear, and the test is for “departures” from linearity; i.e., its simply a goodness-of-fit test for the linear model. Qs (or equivalently Qtrend) tests the null hypothesis of no association. Since its just a Pearsons correlation,

10、we know that its powerful against alternative hypotheses of monotonic trend, but its not at all powerful against curvilinear (or other) associations with a 0 linear component. Model itRich Goldstein recommended logistic regression. Regression is certainly a better context to understand what you are

11、doingrather than all these chi-squared tests that are simply Pearsons correlations or goodness-of-fit tests under another name. Since Pearsons correlation is equivalent to a regression of y on “a”, why not just do the regression . regress y a fw=weight Source | SS df MS Number of obs = 144 -+- F( 1,

12、 142) = 4.63 Model | .692624451 1 .692624451 Prob F = 0.0331 Residual | 21.2448755 142 .1496118 R-squared = 0.0316 -+- Adj R-squared = 0.0248 Total | 21.9375 143 .153409091 Root MSE = .3868 - y | Coef. Std. Err. t P|t| 95% Conf. Interval -+- a | .0955344 .0444011 2.15 0.033 .0077618 .183307 _cons |

13、-.0486823 .1144041 -0.43 0.671 -.2748375 .177473 -But recall that y is a 0/1 variable. Heck, wouldnt you be laughed at by your colleagues if you presented this result? Theyd say, “Dont ya know anything, you dummy, you should be using logit/probit for a 0/1 dependent variable!” But call these same re

14、sults a “chi-squared test for linear trend” and, oh wow, instant respectability. Your colleagues walk away thinking how smart you are and jealous about all those special statistical tests you know. I guess it sounds as if Im agreeing fully with Rich Goldsteins recommendation for logit (or probit, which

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1