model_pooled <-plm(inv ~ value + capital, data = dfp, mdoel ="pooling")
2.2. 固定効果モデル
model_fixed <-plm(inv ~ value + capital, data = dfp, mdoel ="within")
2.3. ランダム効果モデル
model_random <-plm(inv ~ value + capital, data = dfp, mdoel ="random")
結果を比べてみる。
library(texreg)
Warning: package 'texreg' was built under R version 4.4.3
Version: 1.39.4
Date: 2024-07-23
Author: Philip Leifeld (University of Manchester)
Consider submitting praise using the praise or praise_interactive functions.
Please cite the JSS article in your publications -- see citation("texreg").
# ハイブリッドモデルmodel_hybrid <-plm(inv ~ value + capital +Between(value) +Between(capital), model ="random", data = dfp)# 結果を比較してみてみるscreenreg(list(`random model`= model_random,`hybrid model`= model_hybrid))
============================================
random model hybrid model
--------------------------------------------
value 0.11 *** 0.11 ***
(0.01) (0.01)
capital 0.31 *** 0.31 ***
(0.02) (0.02)
(Intercept) -8.53
(47.52)
Between(value) 0.02
(0.03)
Between(capital) -0.28
(0.19)
--------------------------------------------
R^2 0.77 0.77
Adj. R^2 0.75 0.77
Num. obs. 200 200
s_idios 52.77
s_id 84.20
============================================
*** p < 0.001; ** p < 0.01; * p < 0.05