井出草平の研究ノート

自己回帰モデルと交差遅延パネルモデル[Stata]

こちらから。

jincio.github.io

データはこちらに上がっているようだ。

github.com


1.自己回帰モデル

3波を自己回帰させる。

use "nes3wave.dta", clear

GUI

最尤法で実行。

CUI

sem (pid2000 -> pid2002, ) (pid2002 -> pid2004, ), nocapslatent

オプション

  • latent(names)...潜在的な変数名を明示的に指定する。

latent(names) は names が潜在変数の名前の完全な集合であることを指定する。 sem と gsem は通常、潜在変数の最初の文字を大文字にし、観測変数の最初の文字を小文字にすると仮定する; [SEM] semsemのパス表記を参照されたい。 semのパス表記を参照。 latent(names) を指定すると、sem と gsem は、リストされた変数を潜在変数として扱い、それ以外の変数は、大文字小文字にかかわらず、観測された変数として扱う。

  • nocapslatent...大文字を潜在的なものとして扱わない。

nocapslatent は、最初の文字が大文字であることは、潜在変数を指定しないことを指定する。 このオプションは、データセット内のいくつかの観測変数が最初の文字を大文字にしている場合に、観測変数のみでモデルをフィットするときに使用することができる。

. sem (pid2000 -> pid2002, ) (pid2002 -> pid2004, ), nocapslatent
(997 observations with missing values excluded)

Endogenous variables
  Observed: pid2002 pid2004

Exogenous variables
  Observed: pid2000

Fitting target model:
Iteration 0:   log likelihood = -4204.8919  
Iteration 1:   log likelihood = -4204.8919  

Structural equation model                                  Number of obs = 810
Estimation method: ml

Log likelihood = -4204.8919

-------------------------------------------------------------------------------
              |                 OIM
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  pid2002     |
      pid2000 |   .8781976   .0173528    50.61   0.000     .8441868    .9122084
        _cons |   .4674959   .0631342     7.40   0.000     .3437552    .5912366
  ------------+----------------------------------------------------------------
  pid2004     |
      pid2002 |   .9414133   .0177779    52.95   0.000     .9065692    .9762574
        _cons |   .1532385   .0664485     2.31   0.021     .0230019    .2834752
--------------+----------------------------------------------------------------
var(e.pid2002)|   1.140504   .0566721                      1.034667    1.257168
var(e.pid2004)|   1.215196   .0603836                      1.102427    1.339501
-------------------------------------------------------------------------------
LR test of model vs. saturated: chi2(1) = 117.94           Prob > chi2 = 0.0000

SEMモデルには適合度測定が重要である。STATAでモデルを推定した後、estat gof, sta(all)を実行すると、それを得ることができる。

. estat gof, sta(all)

----------------------------------------------------------------------------
Fit statistic        |      Value   Description
---------------------+------------------------------------------------------
Likelihood ratio     |
          chi2_ms(1) |    117.941   model vs. saturated
            p > chi2 |      0.000
          chi2_bs(3) |   2484.410   baseline vs. saturated
            p > chi2 |      0.000
---------------------+------------------------------------------------------
Population error     |
               RMSEA |      0.380   Root mean squared error of approximation
 90% CI, lower bound |      0.324
         upper bound |      0.440
              pclose |      0.000   Probability RMSEA <= 0.05
---------------------+------------------------------------------------------
Information criteria |
                 AIC |   8421.784   Akaike's information criterion
                 BIC |   8449.966   Bayesian information criterion
---------------------+------------------------------------------------------
Baseline comparison  |
                 CFI |      0.953   Comparative fit index
                 TLI |      0.859   Tucker–Lewis index
---------------------+------------------------------------------------------
Size of residuals    |
                SRMR |      0.035   Standardized root mean squared residual
                  CD |      0.760   Coefficient of determination
----------------------------------------------------------------------------

交差遅延モデル Cross-lagged models

GUI

CUI

. sem (pid2000 -> pid2002, ) (pid2000 -> app2002, ) //
 (app2000 -> pid2002, ) (app2000 -> app2002, ),  
 standardized cov( pid2000*app2000) nocapslatent//

(748 observations with missing values excluded)

Endogenous variables
  Observed: pid2002 app2002

Exogenous variables
  Observed: pid2000 app2000

Fitting target model:
Iteration 0:   log likelihood = -7560.2496  
Iteration 1:   log likelihood = -7560.2496  (backed up)

Structural equation model                                Number of obs = 1,059
Estimation method: ml

Log likelihood = -7560.2496

-------------------------------------------------------------------------------------
                    |                 OIM
       Standardized | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------------+----------------------------------------------------------------
Structural          |
  pid2002           |
            pid2000 |   .7729582   .0158919    48.64   0.000     .7418106    .8041057
            app2000 |   .1241617   .0200544     6.19   0.000     .0848557    .1634676
              _cons |   .1624004   .0322593     5.03   0.000     .0991733    .2256274
  ------------------+----------------------------------------------------------------
  app2002           |
            pid2000 |   .4239438   .0308988    13.72   0.000     .3633831    .4845044
            app2000 |   .1370873   .0326491     4.20   0.000     .0730961    .2010784
              _cons |   1.558611    .072866    21.39   0.000     1.415797    1.701426
--------------------+----------------------------------------------------------------
       mean(pid2000)|   1.339711   .0423285    31.65   0.000     1.256749    1.422674
       mean(app2000)|   1.521585   .0451376    33.71   0.000     1.433117    1.610053
--------------------+----------------------------------------------------------------
      var(e.pid2002)|   .2722378   .0142733                       .245652    .3017009
      var(e.app2002)|   .7319102   .0232906                      .6876559    .7790124
        var(pid2000)|          1          .                             .           .
        var(app2000)|          1          .                             .           .
--------------------+----------------------------------------------------------------
cov(pid2000,app2000)|   .5985186   .0197213    30.35   0.000     .5598656    .6371716
-------------------------------------------------------------------------------------
LR test of model vs. saturated: chi2(1) = 90.40                  Prob > chi2 = 0.0000

適合度。

. estat gof, sta(all)

----------------------------------------------------------------------------
Fit statistic        |      Value   Description
---------------------+------------------------------------------------------
Likelihood ratio     |
          chi2_ms(1) |     90.399   model vs. saturated
            p > chi2 |      0.000
          chi2_bs(5) |   1798.754   baseline vs. saturated
            p > chi2 |      0.000
---------------------+------------------------------------------------------
Population error     |
               RMSEA |      0.291   Root mean squared error of approximation
 90% CI, lower bound |      0.242
         upper bound |      0.343
              pclose |      0.000   Probability RMSEA <= 0.05
---------------------+------------------------------------------------------
Information criteria |
                 AIC |  15146.499   Akaike's information criterion
                 BIC |  15211.045   Bayesian information criterion
---------------------+------------------------------------------------------
Baseline comparison  |
                 CFI |      0.950   Comparative fit index
                 TLI |      0.751   Tucker–Lewis index
---------------------+------------------------------------------------------
Size of residuals    |
                SRMR |      0.040   Standardized root mean squared residual
                  CD |      0.753   Coefficient of determination
----------------------------------------------------------------------------