楼主: 薄言往诉
6648 3

[回归分析求助] logistic回归之后,如何输出chi-square或者F值呢? [推广有奖]

  • 0关注
  • 1粉丝

博士生

22%

还不是VIP/贵宾

-

威望
0
论坛币
86 个
通用积分
48.7543
学术水平
0 点
热心指数
4 点
信用等级
0 点
经验
1428 点
帖子
71
精华
0
在线时间
384 小时
注册时间
2014-5-6
最后登录
2023-4-28

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我现在的代码是:logistic Y X1 X2 X3 X4 X5
est store m1

outreg2 [m1] using result.rtf, tstat tdec(2) addtext(Year FE, No, Ind FE, No, Control Variables, No) addstat(Pseudo R2, `e(r2_p)')   replace


然后我看到在help outreg2中有这样一段话:
To test the equality of two of the estimated coefficients and report the results in the table, note that test will sometimes return chi-squared,    then you would instead use addstat(chi-square test, r(chi2)):

    reg mpg foreign weight length
    test foreign length
    outreg2 using myfile, adds(F-test, r(F), Prob > F, `r(p)') replace
    seeout


可是我在代码中加入了(chi-square test, r(chi2))或者(F-test, r(F), Prob > F, `r(p)') ,也就是变成:
outreg2 [m1] using result.rtf, tstat tdec(2) addtext(Year FE, No, Ind FE, No, Control Variables, No) addstat(Pseudo R2, `e(r2_p)', (chi-square test, r(chi2))   replace
或outreg2 [m1] using result.rtf, tstat tdec(2) addtext(Year FE, No, Ind FE, No, Control Variables, No) addstat(Pseudo R2, `e(r2_p)',F-test, r(F), Prob > F, `r(p)')   replace
STATA都会提示我invalid syntax。

不太明白到底应该怎么操作才能输出chi-square呢?
还有这段help中提到的F-test和chi-square test是否都是用来检验模型整体显著性的?他们是同一个检验吗?

向各位求教!感谢~~
二维码

扫码加我 拉你入群

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

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

关键词:logistic回归 logistic ogistic logisti Square

沙发
6513 在职认证  发表于 2019-10-25 11:19:31 |只看作者 |坛友微信交流群
logit Y X1 X2 X3
eststo m1
logit Y X1 X2 X3 X4
eststo m2
logit Y X1 X2 X3 X4 X5
eststo m3

esttab m1 m2 m3,se(3) b(3) t(3) star(* 0.05 ** 0.01 *** 0.001) compress nogap ///
> stats(N chi2, fmt(%12.0f  %9.3f)) varwidth(20)  

使用道具

藤椅
蓝色 发表于 2019-10-25 13:44:57 |只看作者 |坛友微信交流群
. logistic foreign price length weight

Logistic regression                             Number of obs     =         74
                                                LR chi2(3)        =      54.49
                                                Prob > chi2       =     0.0000
Log likelihood = -17.788577                     Pseudo R2         =     0.6050

------------------------------------------------------------------------------
     foreign | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       price |   1.000948   .0003015     3.15   0.002     1.000357    1.001539
      length |   1.050254   .0842469     0.61   0.541     .8974594    1.229063
      weight |   .9928983   .0027367    -2.59   0.010     .9875489    .9982767
       _cons |   34.28891   310.2732     0.39   0.696     6.80e-07    1.73e+09
------------------------------------------------------------------------------
Note: _cons estimates baseline odds.

. ereturn list

scalars:
               e(rank) =  4
                  e(N) =  74
                 e(ic) =  6
                  e(k) =  4
               e(k_eq) =  1
               e(k_dv) =  1
          e(converged) =  1
                 e(rc) =  0
                 e(ll) =  -17.78857673643442
         e(k_eq_model) =  1
               e(ll_0) =  -45.03320955699139
               e(df_m) =  3
               e(chi2) =  54.48926564111394
                  e(p) =  8.82395878513e-12
              e(N_cdf) =  0
              e(N_cds) =  0
               e(r2_p) =  .604989808378587

macros:
            e(cmdline) : "logistic foreign price length weight"
                e(cmd) : "logistic"
            e(predict) : "logistic_p"
          e(estat_cmd) : "logit_estat"
          e(marginsok) : "default Pr"
       e(marginsnotok) : "stdp DBeta DEviance DX2 DDeviance Hat Number Residuals RStandard SCore"
              e(title) : "Logistic regression"
           e(chi2type) : "LR"
                e(opt) : "moptimize"
                e(vce) : "oim"
               e(user) : "mopt__logit_d2()"
          e(ml_method) : "d2"
          e(technique) : "nr"
              e(which) : "max"
             e(depvar) : "foreign"
         e(properties) : "b V"

matrices:
                  e(b) :  1 x 4
                  e(V) :  4 x 4
                e(mns) :  1 x 4
              e(rules) :  1 x 4
               e(ilog) :  1 x 20
           e(gradient) :  1 x 4

functions:
             e(sample)   

logistic 回归完是没有r(chi2)   、 r(F)  
当然出错

使用道具

板凳
6513 在职认证  发表于 2019-11-4 08:56:11 |只看作者 |坛友微信交流群
蓝色 发表于 2019-10-25 13:44
. logistic foreign price length weight

Logistic regression                             Number of  ...
有LR chi 的

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-2 15:59