分析結果の解釈については、書籍をご参照ください。以下はWindows10、R version 4.2.1で実行しています。

データを読み込むにあたって、作業場所の指定とそこにデータが置いてあることが前提になります。 R本体を操作している場合は、「ファイル」→「ディレクトリの変更」でデータの置いてある場所を指定するのが簡単です。 RStudioを操作している場合は、例えばデスクトップの「R」という名前のフォルダにデータがあるとすると

setwd("C:/Users/ユーザー名/Desktop/R")

を最初に実行するのがよいでしょう。ユーザー名は各自異なるので注意です。

使用するデータを読み込み、表示します。なお、R version 4.1以前で読み込む際には

data1 <- read.csv("ファイル名.csv", fileEncoding = "UTF-8-BOM")

のように、エンコードのオプションを指定する必要があります。version 4.2以降では必要ありませんので、以下ではオプションを指定していません。

data1 <- read.csv("ch9.csv")

本章で使用するパッケージを読み込みますが、パッケージはインストールしておく必要があります。 以下のようにコマンドでインストールするか、RやRStudioからクリックでインストールすることもできます。

install.packages(“stargazer”, dependencies = TRUE)

パッケージの機能が使えるように読み込みます。

library(ggplot2)
library(plm)
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.3. https://CRAN.R-project.org/package=stargazer

表9-1 5時点のパネルデータ

data1
##     pref year suic unemp alone   popd  rain
## 1      1 1995 16.8   4.4 27.88  261.6 12.41
## 2      2 1995 20.1   5.0 21.88  469.3 12.31
## 3      3 1995 24.3   3.2 22.46  387.7 14.15
## 4      4 1995 14.7   3.9 26.89  754.7  9.75
## 5      5 1995 31.8   3.4 18.63  386.2 19.07
## 6      6 1995 21.9   2.7 17.56  439.9 12.06
## 7      7 1995 18.9   3.4 20.72  516.9 11.03
## 8      8 1995 17.0   3.8 19.77  755.1 12.54
## 9      9 1995 18.7   3.7 20.71  687.5 14.03
## 10    10 1995 19.6   3.7 19.96  887.5 10.76
## 11    11 1995 15.6   4.4 21.45 2661.3 11.98
## 12    12 1995 14.6   4.3 24.09 1680.7 10.95
## 13    13 1995 16.2   4.9 38.12 8532.6 12.20
## 14    14 1995 14.8   4.6 28.34 5747.3 14.40
## 15    15 1995 23.9   2.7 19.65  545.4 20.78
## 16    16 1995 19.7   2.8 17.66  608.8 24.28
## 17    17 1995 16.0   3.3 25.53  851.2 26.54
## 18    18 1995 16.7   2.5 19.35  782.8 25.88
## 19    19 1995 18.1   3.4 22.53  936.2  8.45
## 20    20 1995 17.8   2.5 21.35  667.7  9.80
## 21    21 1995 16.5   3.2 18.50 1010.4 17.18
## 22    22 1995 14.2   3.5 21.30 1381.5 16.18
## 23    23 1995 15.0   3.7 25.11 2362.8 13.93
## 24    24 1995 16.2   3.4 20.11  928.2 16.66
## 25    25 1995 13.8   3.1 19.60  997.7 16.82
## 26    26 1995 16.4   4.4 29.00 2328.0 13.66
## 27    27 1995 16.0   6.2 27.44 6777.5 13.79
## 28    28 1995 16.8   5.1 22.37 2022.6 11.91
## 29    29 1995 13.5   4.2 17.71 1717.1 12.87
## 30    30 1995 21.2   4.5 20.07  992.5 14.11
## 31    31 1995 19.8   3.0 19.75  696.6 20.87
## 32    32 1995 25.0   2.4 20.89  595.8 17.84
## 33    33 1995 13.1   3.7 23.18  888.1 10.28
## 34    34 1995 17.9   3.7 26.33 1301.3 13.90
## 35    35 1995 19.3   3.6 24.51  913.1 19.11
## 36    36 1995 16.1   4.5 21.81  829.3 12.26
## 37    37 1995 15.6   3.9 21.93 1046.5  9.99
## 38    38 1995 16.8   4.4 24.12  907.2 13.93
## 39    39 1995 19.8   5.4 26.89  703.4 19.09
## 40    40 1995 16.6   5.5 27.62 1806.1 15.93
## 41    41 1995 15.9   3.5 19.45  652.8 18.57
## 42    42 1995 16.8   4.2 23.46  942.8 15.45
## 43    43 1995 16.6   4.2 23.25  697.6 18.76
## 44    44 1995 17.4   3.9 24.42  695.5 13.09
## 45    45 1995 25.4   4.2 23.85  643.2 20.42
## 46    46 1995 21.7   4.1 27.72  544.4 27.58
## 47    47 1995 19.5  10.3 21.94 1144.9 17.63
## 48     1 2000 26.7   4.8 29.95  259.5 14.45
## 49     2 2000 27.5   5.4 24.08  460.7 14.06
## 50     3 2000 32.2   4.0 24.47  381.7 14.18
## 51     4 2000 23.0   4.9 28.59  755.7 11.87
## 52     5 2000 38.5   4.3 21.24  377.0 15.63
## 53     6 2000 26.1   3.3 19.98  436.5 11.65
## 54     7 2000 23.6   4.3 22.60  504.2 12.91
## 55     8 2000 24.0   4.2 21.42  750.9 14.00
## 56     9 2000 25.6   4.1 22.42  680.5 16.34
## 57    10 2000 24.8   4.1 21.78  882.5 11.63
## 58    11 2000 20.6   4.7 23.15 2704.2 13.24
## 59    12 2000 21.7   4.7 25.45 1699.2 13.29
## 60    13 2000 23.6   4.8 40.85 8642.8 16.03
## 61    14 2000 20.6   4.8 29.54 5817.0 15.58
## 62    15 2000 33.0   3.9 21.69  552.5 16.41
## 63    16 2000 26.8   3.4 19.93  605.8 19.55
## 64    17 2000 20.4   3.6 25.98  854.1 21.26
## 65    18 2000 21.1   3.1 20.94  777.6 19.76
## 66    19 2000 22.8   3.8 24.17  934.6 14.79
## 67    20 2000 26.4   3.1 23.13  664.5  7.88
## 68    21 2000 23.5   3.7 19.74  982.7 16.80
## 69    22 2000 19.9   3.8 22.91 1379.5 23.06
## 70    23 2000 20.9   4.0 26.23 2386.2 17.36
## 71    24 2000 20.6   3.9 21.73  918.7 16.00
## 72    25 2000 19.8   3.7 22.22 1041.7 14.75
## 73    26 2000 25.5   4.9 30.86 2289.4 13.69
## 74    27 2000 25.7   7.0 29.78 6701.6 11.64
## 75    28 2000 23.2   5.3 24.95 2014.3 10.27
## 76    29 2000 17.9   4.9 19.13 1696.3 13.20
## 77    30 2000 25.9   5.0 21.97  975.0 14.14
## 78    31 2000 22.6   3.6 22.69  672.5 19.26
## 79    32 2000 30.8   3.0 24.02  606.3 15.68
## 80    33 2000 19.5   4.3 24.98  882.5  8.13
## 81    34 2000 21.2   4.3 28.02 1276.8 11.39
## 82    35 2000 26.2   4.1 26.75  873.6 13.88
## 83    36 2000 19.6   4.9 24.40  806.8 13.37
## 84    37 2000 22.7   4.7 23.81 1031.9  8.57
## 85    38 2000 23.4   5.0 26.30  894.2 11.50
## 86    39 2000 25.6   5.3 29.85  696.8 25.00
## 87    40 2000 24.4   5.9 30.24 1832.4 13.44
## 88    41 2000 25.1   4.4 20.96  654.3 17.11
## 89    42 2000 24.6   4.9 25.30  937.8 15.61
## 90    43 2000 22.5   4.4 25.04  677.2 18.26
## 91    44 2000 26.6   4.5 26.42  690.3 14.58
## 92    45 2000 32.6   5.0 25.74  637.6 25.94
## 93    46 2000 26.9   4.9 30.12  550.9 26.67
## 94    47 2000 26.7   9.4 24.26 1137.3 26.13
## 95     1 2005 27.4   6.5 32.40  257.0 12.37
## 96     2 2005 36.8   8.4 25.40  448.4 16.27
## 97     3 2005 34.2   6.2 25.39  373.3 13.77
## 98     4 2005 26.9   6.9 28.98  754.0 10.29
## 99     5 2005 39.2   6.1 22.75  363.1 18.21
## 100    6 2005 31.1   4.8 21.81  426.7 11.96
## 101    7 2005 29.1   6.0 24.33  495.8 10.68
## 102    8 2005 23.7   5.9 23.13  748.3 11.47
## 103    9 2005 25.0   5.4 24.40  684.5 13.33
## 104   10 2005 25.3   5.7 23.59  882.1 11.14
## 105   11 2005 22.4   5.7 25.19 2749.5 11.91
## 106   12 2005 22.1   5.6 26.94 1736.2 13.15
## 107   13 2005 21.9   5.6 42.53 9009.5 14.82
## 108   14 2005 19.8   5.5 30.94 6021.9 14.11
## 109   15 2005 29.7   4.8 23.26  542.5 18.13
## 110   16 2005 30.7   4.4 21.82  600.8 27.77
## 111   17 2005 22.7   4.7 27.61  848.9 25.45
## 112   18 2005 23.5   4.2 22.30  770.3 27.31
## 113   19 2005 26.9   5.3 25.87  930.7  8.18
## 114   20 2005 25.4   4.6 24.16  659.6  8.68
## 115   21 2005 25.4   4.8 21.43  980.5 14.51
## 116   22 2005 21.9   4.6 24.65 1388.3 17.08
## 117   23 2005 20.7   4.6 28.75 2451.1  9.01
## 118   24 2005 20.0   4.7 24.02  923.3  9.28
## 119   25 2005 22.2   4.7 24.33 1070.8 14.24
## 120   26 2005 21.1   6.0 32.94 2291.9  9.55
## 121   27 2005 24.2   8.6 32.08 6703.4  9.09
## 122   28 2005 23.4   6.5 26.75 2026.7  6.87
## 123   29 2005 20.6   6.6 20.86 1671.1  9.11
## 124   30 2005 25.9   6.3 23.68  943.6  9.86
## 125   31 2005 24.4   5.5 25.32  665.5 20.03
## 126   32 2005 27.8   4.4 25.59  590.8 14.73
## 127   33 2005 21.6   5.3 27.74  885.2  7.33
## 128   34 2005 22.0   5.0 29.69 1275.2 13.23
## 129   35 2005 26.1   5.1 28.28  852.6 16.13
## 130   36 2005 20.0   7.3 26.91  792.7  9.99
## 131   37 2005 20.0   6.1 25.61 1020.8  7.72
## 132   38 2005 25.4   6.4 28.70  878.6 11.79
## 133   39 2005 29.8   7.9 31.76  681.5 17.46
## 134   40 2005 24.8   7.4 31.75 1841.5 10.20
## 135   41 2005 25.0   5.7 22.76  646.5 13.57
## 136   42 2005 29.3   6.5 27.11  913.1 13.73
## 137   43 2005 24.4   5.9 26.53  670.7 13.25
## 138   44 2005 24.3   6.1 28.50  683.2 14.19
## 139   45 2005 30.6   6.1 27.70  628.2 22.20
## 140   46 2005 26.2   6.9 31.61  540.5 19.88
## 141   47 2005 24.2  11.9 27.43 1171.4 19.48
## 142    1 2010 25.4   7.1 34.85  248.0 13.25
## 143    2 2010 29.5   9.0 27.58  424.7 15.70
## 144    3 2010 32.2   7.1 27.41  360.1 16.34
## 145    4 2010 22.9   7.8 31.25  746.6 14.44
## 146    5 2010 33.2   7.0 24.57  340.0 18.91
## 147    6 2010 26.4   5.8 23.17  409.4 14.19
## 148    7 2010 25.2   7.1 26.22  479.8 15.19
## 149    8 2010 24.0   6.7 25.75  745.8 15.31
## 150    9 2010 25.2   6.3 27.33  673.4 17.18
## 151   10 2010 25.9   6.3 26.21  872.7 14.91
## 152   11 2010 23.3   6.3 28.43 2795.0 13.07
## 153   12 2010 22.1   6.1 30.30 1760.1 15.25
## 154   13 2010 22.4   5.9 45.79 9460.6 16.80
## 155   14 2010 21.4   5.8 33.79 6167.2 18.56
## 156   15 2010 28.7   5.5 25.66  527.2 20.72
## 157   16 2010 23.1   5.2 24.17  590.1 27.87
## 158   17 2010 22.6   5.4 29.56  842.5 28.59
## 159   18 2010 20.2   5.2 24.50  750.7 27.17
## 160   19 2010 27.5   6.2 27.54  906.3 13.20
## 161   20 2010 23.6   5.4 25.71  649.6 10.58
## 162   21 2010 20.9   5.6 23.61  945.7 24.41
## 163   22 2010 23.2   5.8 26.76 1367.4 28.46
## 164   23 2010 20.0   5.1 31.52 2490.8 17.30
## 165   24 2010 19.4   5.1 26.89  907.4 16.24
## 166   25 2010 22.4   5.1 27.23 1088.1 18.58
## 167   26 2010 22.8   6.2 35.76 2239.1 20.61
## 168   27 2010 24.4   8.0 35.78 6728.7 15.68
## 169   28 2010 23.0   6.5 30.23 2013.6 16.33
## 170   29 2010 19.3   7.4 23.70 1645.1 15.88
## 171   30 2010 25.1   6.7 27.41  914.5 15.78
## 172   31 2010 24.9   5.9 27.00  646.4 18.31
## 173   32 2010 26.0   4.6 27.56  556.9 18.57
## 174   33 2010 21.0   7.2 30.02  873.4 12.16
## 175   34 2010 21.7   5.4 32.76 1249.0 15.86
## 176   35 2010 24.3   5.9 30.63  845.8 20.84
## 177   36 2010 19.6   7.6 29.02  767.0 15.06
## 178   37 2010 21.9   6.3 28.85  993.0  9.88
## 179   38 2010 21.1   7.3 30.96  858.7 14.41
## 180   39 2010 26.0   7.7 33.75  658.7 30.93
## 181   40 2010 23.5   7.8 34.95 1828.6 17.29
## 182   41 2010 26.1   6.3 24.74  637.5 19.41
## 183   42 2010 26.0   6.6 29.43  873.2 18.98
## 184   43 2010 25.1   6.7 28.75  665.2 20.73
## 185   44 2010 22.5   7.1 30.88  685.4 12.98
## 186   45 2010 27.2   7.0 29.75  615.1 28.11
## 187   46 2010 24.4   6.8 33.43  521.7 29.42
## 188   47 2010 25.6  11.0 29.39 1193.0 28.96
## 189    1 2015 19.5   4.6 37.29  240.5 12.75
## 190    2 2015 20.5   5.3 30.13  405.1 10.04
## 191    3 2015 23.3   4.0 30.36  344.5 10.94
## 192    4 2015 17.6   4.9 34.36  739.8 14.45
## 193    5 2015 25.8   4.3 27.92  319.3 14.91
## 194    6 2015 21.8   3.6 25.49  389.6 10.27
## 195    7 2015 21.6   4.4 30.59  453.9 12.84
## 196    8 2015 18.7   4.5 28.36  733.9 12.27
## 197    9 2015 19.7   4.3 28.84  661.9 16.51
## 198   10 2015 21.7   4.3 28.63  865.6 12.32
## 199   11 2015 18.1   4.3 30.48 2811.4 13.35
## 200   12 2015 19.5   4.1 32.37 1750.7 16.16
## 201   13 2015 17.7   3.9 47.30 9528.5 17.82
## 202   14 2015 17.0   3.9 35.50 6205.8 18.36
## 203   15 2015 22.0   3.7 27.60  508.1 14.68
## 204   16 2015 20.5   3.1 26.15  578.6 21.41
## 205   17 2015 18.4   3.4 31.51  829.1 21.65
## 206   18 2015 15.5   3.3 26.39  730.3 23.00
## 207   19 2015 16.8   4.4 29.53  874.8 11.15
## 208   20 2015 18.3   3.4 27.86  650.7 10.58
## 209   21 2015 18.9   3.4 25.80  918.9 22.67
## 210   22 2015 18.8   4.0 28.53 1345.8 28.05
## 211   23 2015 16.1   3.4 33.48 2504.6 18.03
## 212   24 2015 19.1   3.4 29.42  881.8 19.79
## 213   25 2015 17.5   3.5 28.45 1080.8 17.84
## 214   26 2015 16.7   4.4 38.21 2223.8 20.43
## 215   27 2015 19.1   5.3 37.53 6643.3 16.49
## 216   28 2015 17.8   4.6 32.70 1988.8 15.78
## 217   29 2015 15.9   4.9 25.70 1594.7 15.12
## 218   30 2015 19.2   4.5 29.35  864.1 15.38
## 219   31 2015 18.3   3.9 29.49  636.6 17.50
## 220   32 2015 23.0   2.9 30.21  534.6 17.06
## 221   33 2015 18.3   4.1 32.22  866.0 13.34
## 222   34 2015 17.6   3.7 34.49 1230.7 16.41
## 223   35 2015 20.0   4.0 33.32  823.0 20.61
## 224   36 2015 17.3   5.0 32.16  748.1 19.86
## 225   37 2015 16.3   4.0 31.55  970.9 12.10
## 226   38 2015 19.5   4.4 33.58  827.9 16.87
## 227   39 2015 15.8   4.9 36.43  626.1 29.67
## 228   40 2015 18.0   5.3 37.37 1847.4 18.68
## 229   41 2015 16.7   4.1 26.87  623.6 20.83
## 230   42 2015 17.0   4.4 31.94  821.6 23.92
## 231   43 2015 19.9   4.5 30.92  638.8 22.92
## 232   44 2015 16.6   4.5 33.20  648.4 16.78
## 233   45 2015 23.3   4.6 32.12  596.8 31.93
## 234   46 2015 19.1   4.7 35.66  497.5 36.64
## 235   47 2015 20.8   6.3 32.36 1226.2 14.25

都道府県ID(pref)、データ年(year)、自殺率(suic)、失業率(unemp)、単独世帯割合(alone)、人口密度(popd)、降水量(rain)となっています。

人口密度の対数(lpopd)、因子化したデータ年(ydum)を作成します。

data1$lpopd <- log(data1$popd)
data1$ydum <- as.factor(data1$year)

図9-1 自殺率と完全失業率の散布図

ggplot(data1,aes(x=unemp,y=suic, shape=ydum))+geom_point()+xlab("失業率(%)")+ylab("自殺率(人口10万人あたり)")+theme_classic()+labs(shape="データ年")

固定効果モデル

fixed <- plm(suic~unemp+alone+lpopd+rain+ydum, data=data1,
             index=c("pref", "year"), model="within")
summary(fixed)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = suic ~ unemp + alone + lpopd + rain + ydum, data = data1, 
##     model = "within", index = c("pref", "year"))
## 
## Balanced Panel: n = 47, T = 5, N = 235
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -3.792045 -0.958101 -0.010295  0.780953  4.853801 
## 
## Coefficients:
##           Estimate Std. Error t-value  Pr(>|t|)    
## unemp     1.214271   0.307632  3.9471 0.0001133 ***
## alone     0.229351   0.239283  0.9585 0.3391005    
## lpopd    26.218551   4.575438  5.7303 4.147e-08 ***
## rain      0.119443   0.045588  2.6201 0.0095419 ** 
## ydum2000  5.531842   0.632418  8.7471 1.534e-15 ***
## ydum2005  4.608279   1.267395  3.6360 0.0003613 ***
## ydum2010  1.910615   1.912400  0.9991 0.3191035    
## ydum2015 -0.276571   2.113398 -0.1309 0.8960277    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2767
## Residual Sum of Squares: 455.07
## R-Squared:      0.83554
## Adj. R-Squared: 0.7862
## F-statistic: 114.309 on 8 and 180 DF, p-value: < 2.22e-16

プールドモデル

pool <- plm(suic~unemp+alone+lpopd+rain+ydum, data=data1,
            index=c("pref", "year"), model="pooling")
summary(pool)
## Pooling Model
## 
## Call:
## plm(formula = suic ~ unemp + alone + lpopd + rain + ydum, data = data1, 
##     model = "pooling", index = c("pref", "year"))
## 
## Balanced Panel: n = 47, T = 5, N = 235
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -6.26245 -2.03015 -0.18391  1.43969 11.82567 
## 
## Coefficients:
##              Estimate Std. Error t-value  Pr(>|t|)    
## (Intercept) 31.734567   2.136790 14.8515 < 2.2e-16 ***
## unemp        0.419512   0.185211  2.2651   0.02446 *  
## alone        0.068225   0.060181  1.1337   0.25814    
## lpopd       -2.609467   0.322157 -8.1000 3.417e-14 ***
## rain         0.070016   0.039770  1.7605   0.07967 .  
## ydum2000     6.072405   0.635421  9.5565 < 2.2e-16 ***
## ydum2005     6.349399   0.729951  8.6984 7.041e-16 ***
## ydum2010     4.239894   0.817991  5.1833 4.830e-07 ***
## ydum2015    -0.110780   0.807738 -0.1371   0.89104    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    5057.4
## Residual Sum of Squares: 2050.6
## R-Squared:      0.59454
## Adj. R-Squared: 0.58019
## F-statistic: 41.4238 on 8 and 226 DF, p-value: < 2.22e-16

F検定

pFtest(fixed, pool)
## 
##  F test for individual effects
## 
## data:  suic ~ unemp + alone + lpopd + rain + ydum
## F = 13.72, df1 = 46, df2 = 180, p-value < 2.2e-16
## alternative hypothesis: significant effects

変量効果モデル

random <- plm(suic~unemp+alone+lpopd+rain+ydum, data=data1,
              index=c("pref", "year"), model="random")
summary(random)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = suic ~ unemp + alone + lpopd + rain + ydum, data = data1, 
##     model = "random", index = c("pref", "year"))
## 
## Balanced Panel: n = 47, T = 5, N = 235
## 
## Effects:
##                 var std.dev share
## idiosyncratic 2.528   1.590 0.277
## individual    6.593   2.568 0.723
## theta: 0.7331
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -4.922717 -1.015961 -0.091974  0.923814  6.563164 
## 
## Coefficients:
##              Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept) 28.575689   4.150268  6.8853 5.768e-12 ***
## unemp        0.408450   0.234597  1.7411 0.0816712 .  
## alone        0.050110   0.111294  0.4502 0.6525314    
## lpopd       -2.163947   0.657082 -3.2933 0.0009903 ***
## rain         0.105650   0.043569  2.4249 0.0153120 *  
## ydum2000     6.113029   0.431316 14.1730 < 2.2e-16 ***
## ydum2005     6.499727   0.708589  9.1728 < 2.2e-16 ***
## ydum2010     4.284758   0.975539  4.3922 1.122e-05 ***
## ydum2015    -0.012794   1.034520 -0.0124 0.9901329    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2930.1
## Residual Sum of Squares: 661.95
## R-Squared:      0.77409
## Adj. R-Squared: 0.76609
## Chisq: 774.394 on 8 DF, p-value: < 2.22e-16

ラグランジュ乗数検定

plmtest(pool, type=c("bp"))
## 
##  Lagrange Multiplier Test - (Breusch-Pagan)
## 
## data:  suic ~ unemp + alone + lpopd + rain + ydum
## chisq = 204.3, df = 1, p-value < 2.2e-16
## alternative hypothesis: significant effects

ハウスマン検定

phtest(fixed,random)
## 
##  Hausman Test
## 
## data:  suic ~ unemp + alone + lpopd + rain + ydum
## chisq = 40.511, df = 8, p-value = 2.572e-06
## alternative hypothesis: one model is inconsistent

表9-2 プールド、固定効果、変量効果の各モデルの推定結果

stargazer(pool,fixed,random,type="text",star.cutoffs=c(0.1,0.05,0.01), keep.stat=c("n","rsq","adj.rsq"))
## 
## ==========================================
##                   Dependent variable:     
##              -----------------------------
##                          suic             
##                 (1)       (2)       (3)   
## ------------------------------------------
## unemp         0.420**  1.214***   0.408*  
##               (0.185)   (0.308)   (0.235) 
##                                           
## alone          0.068     0.229     0.050  
##               (0.060)   (0.239)   (0.111) 
##                                           
## lpopd        -2.609*** 26.219*** -2.164***
##               (0.322)   (4.575)   (0.657) 
##                                           
## rain          0.070*   0.119***   0.106** 
##               (0.040)   (0.046)   (0.044) 
##                                           
## ydum2000     6.072***  5.532***  6.113*** 
##               (0.635)   (0.632)   (0.431) 
##                                           
## ydum2005     6.349***  4.608***  6.500*** 
##               (0.730)   (1.267)   (0.709) 
##                                           
## ydum2010     4.240***    1.911   4.285*** 
##               (0.818)   (1.912)   (0.976) 
##                                           
## ydum2015      -0.111    -0.277    -0.013  
##               (0.808)   (2.113)   (1.035) 
##                                           
## Constant     31.735***           28.576***
##               (2.137)             (4.150) 
##                                           
## ------------------------------------------
## Observations    235       235       235   
## R2             0.595     0.836     0.774  
## Adjusted R2    0.580     0.786     0.766  
## ==========================================
## Note:          *p<0.1; **p<0.05; ***p<0.01