全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
7853 3
2019-10-25
我现在的代码是: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是否都是用来检验模型整体显著性的?他们是同一个检验吗?

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

扫码加我 拉你入群

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

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

全部回复
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)  
当然出错
二维码

扫码加我 拉你入群

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

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

2019-11-4 08:56:11
蓝色 发表于 2019-10-25 13:44
. logistic foreign price length weight

Logistic regression                             Number of  ...
有LR chi 的
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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