Py学习  »  Git

Stata学习:如何构建条件Logit模型?clogit

Stata与R学习 • 1 年前 • 217 次点击  

文献来源

  1. Wang, Y., Stone, R.W. (2023). China visits: a dataset of Chinese leaders’ foreign visits. The Review of International Organizations 18, 201–225.

示例代码

clear
cd "C:\Download\11558_2022_9459_MOESM1_ESM\Data_and_Code_for_China_Visits\Regression_Tables"
use "determinants.dta"

drop if taiwan == 1

gl c = "log_population log_gdp_per_capita gdp_growth  resources polity2 pctagreechina DL president_l1 premier_l1"
clogit president $c i.year,  group(icode) robust cluster (ccode)

得到结果

note: multiple positive outcomes within groups encountered.
note: 59 groups (1,015 obs) omitted because of all positive or
      all negative outcomes.

Iteration 0:  Log pseudolikelihood = -440.52462  
Iteration 1:  Log pseudolikelihood = -435.30707  
Iteration 2:  Log pseudolikelihood = -435.22917  
Iteration 3:  Log pseudolikelihood = -435.22894  
Iteration 4:  Log pseudolikelihood = -435.22894  

Conditional (fixed-effects) logistic regression         Number of obs =  1,929
                                                        Wald chi2(29) =  96.17
                                                        Prob > chi2   = 0.0000
Log pseudolikelihood = -435.22894                       Pseudo R2     = 0.0970

                                       (Std. err. adjusted for 95 clusters in ccode)
------------------------------------------------------------------------------------
                   |               Robust
         president | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
    log_population |   1.095937   1.000462     1.10   0.273    -.8649324    3.056807
log_gdp_per_capita |    .112604   .3336109     0.34   0.736    -.5412613    .7664693
        gdp_growth |   17.02872   11.71093     1.45   0.146    -5.924273    39.98172
         resources |  -1.834604    2.03794    -0.90   0.368    -5.828893    2.159685
           polity2 |   2.127391   4.429714     0.48   0.631    -6.554689    10.80947
     pctagreechina |   1.061198   1.199933     0.88   0.376    -1.290628    3.413024
                DL |  -.2985524   .4751356    -0.63   0.530    -1.229801    .6326962
      president_l1 |  -3.057931   .7599287    -4.02   0.000    -4.547364   -1.568498
        premier_l1 |   .1229044   .2422496     0.51   0.612    -.3518961    .5977048
                   |
              year |
             2000  |  -.4239574   .5294028    -0.80   0.423    -1.461568     .613653
             2001  |  -.1687312   .5110501    -0.33   0.741    -1.170371    .8329085
             2002  |  -.1455962   .5398465    -0.27   0.787    -1.203676    .9124834
             2003  |  -.9128433   .3925634    -2.33   0.020    -1.682253   -.1434332
             2004  |  -.0951987   .4316731    -0.22   0.825    -.9412625    .7508651
             2005  |  -.2658889   .4868107    -0.55   0.585     -1.22002    .6882425
             2006  |  -.4192778   .5240573    -0.80   0.424    -1.446411    .6078557
             2007  |  -.2751409   .5228921    -0.53   0.599    -1.299991    .7497088
             2008  |  -.6980163   .5875806    -1.19   0.235    -1.849653    .4536205
             2009  |  -.1695691   .5411869    -0.31   0.754    -1.230276    .8911378
             2010  |  -.9612306   .4738397    -2.03   0.042    -1.889939   -.0325219
             2011  |  -1.430433   .5244163    -2.73   0.006    -2.458271   -.4025964
             2012  |  -2.238804   .8782035    -2.55   0.011    -3.960051   -.5175567
             2013  |  -.4468239   .5744448    -0.78   0.437    -1.572715    .6790672
             2014  |   .1011455   .5732906     0.18   0.860    -1.022483    1.224774
             2015  |   -.557435   .5906329    -0.94   0.345    -1.715054    .6001842
             2016  |  -.2970308   .5759458    -0.52   0.606    -1.425864    .8318023
             2017  |  -1.070766   .6261992    -1.71   0.087    -2.298094    .1565615
             2018  |  -.5673587   .5546222    -1.02   0.306    -1.654398    .5196808
             2019  |  -1.152686   .6467385    -1.78   0.075     -2.42027    .1148981
------------------------------------------------------------------------------------

期刊排版

Online Appendix for China Visits:

(完)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/165503