Main rice
# pooled ols
reg1 <- plm(eq_1, data = main_df, index = c("ID", "year"), model = "pooling")
# fixed effect
reg2 <- plm(eq_1, data = main_df, index = c("ID", "year"), model = "within", effect = "individual")
# random effect
reg3 <- plm(eq_1, data = main_df, index = c("ID", "year"), model = "random",
random.method = "walhus", effect = "individual")
# pooled spatial lag
reg4 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "pooling", lag = TRUE, spatial.error = "none")
# pooled spatial error
reg5 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "pooling", lag = FALSE, spatial.error = "b")
# fixed effect spatial lag
reg6 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "within", effect = "individual",
lag = TRUE, spatial.error = "none")
# random effects spatial lag
reg7 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "random", lag = TRUE, spatial.error = "none")
# fixed effects spatial error
reg8 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "within", effect = "individual",
lag = FALSE, spatial.error = "b", quiet = TRUE)
# random effects spatial error
reg9 <- spml(formula = eq_1, data = main_df, index = c("ID", "year"),
listw = queen.TH76.listw, model = "random", lag = FALSE, spatial.error = "b")
Tests
The results from tests suggest that there are spatial lag and
spatial error dependence in the TFP growth determinant model. It means
we should employ spatial regression instead of normal OLS or normal
panel regression.
Test’s results suggest that fixed effect spatial lag and fixed
effect spatial error are the most suitable models.
#LM test for random effect VS OLS
plmtest(reg1) # not reject H0 >> OLS is better
##
## Lagrange Multiplier Test - (Honda)
##
## data: eq_1
## normal = -2.6179, p-value = 0.9956
## alternative hypothesis: significant effects
#LM test for fixed effect VS OLS
pFtest(reg2, reg1) # not reject H0 >> OLS is better
##
## F test for individual effects
##
## data: eq_1
## F = 0.82046, df1 = 75, df2 = 1360, p-value = 0.8631
## alternative hypothesis: significant effects
# Hausman Test for fixed effect VS random effect
# H0: alpha is not diff >> reject H0 >> use FE model
phtest(reg2, reg3) # reject H0 >> fixed effect is better
##
## Hausman Test
##
## data: eq_1
## chisq = 47.289, df = 8, p-value = 1.351e-07
## alternative hypothesis: one model is inconsistent
# spatial test
# moran I
iden_main <- diag(19)
mat_main <- listw2mat(queen.TH76.listw)
matpooled_main <- kronecker(iden_main, mat_main)
matpooled_mainlistw <- mat2listw(matpooled_main)
main_df_m <- main_df[order(main_df$year, main_df$ID),]
reg_main <- lm(eq_1, data = main_df_m)
lm.morantest(model = reg_main, listw = matpooled_mainlistw)
##
## Global Moran I for regression residuals
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## Moran I statistic standard deviate = 12.898, p-value < 2.2e-16
## alternative hypothesis: greater
## sample estimates:
## Observed Moran I Expectation Variance
## 0.2328977980 -0.0028394323 0.0003340583
lm.LMtests(model = reg_main, listw = matpooled_mainlistw, test = "all")
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## LMerr = 160.94, df = 1, p-value < 2.2e-16
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## LMlag = 173.73, df = 1, p-value < 2.2e-16
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## RLMerr = 0.63281, df = 1, p-value = 0.4263
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## RLMlag = 13.423, df = 1, p-value = 0.0002485
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = main_df_m)
## weights: matpooled_mainlistw
##
## SARMA = 174.37, df = 2, p-value < 2.2e-16
# Locally robust panel Lagrange Multiplier tests for spatial dependence
slmtest(formula = eq_1, data = main_df, listw = queen.TH76.listw, model="pooling", test = "lme") # reject H0 >> spatial error dependence
##
## LM test for spatial error dependence
##
## data: formula
## LM = 160.94, df = 1, p-value < 2.2e-16
## alternative hypothesis: spatial error dependence
slmtest(formula = eq_1, data = main_df, listw = queen.TH76.listw, model="pooling", test = "lml") # reject H0 >> spatial lag dependence
##
## LM test for spatial lag dependence
##
## data: formula
## LM = 173.73, df = 1, p-value < 2.2e-16
## alternative hypothesis: spatial lag dependence
slmtest(formula = eq_1, data = main_df, listw = queen.TH76.listw, model="pooling", test = "rlme")
##
## Locally robust LM test for spatial error dependence sub spatial lag
##
## data: formula
## LM = 0.63281, df = 1, p-value = 0.4263
## alternative hypothesis: spatial error dependence
slmtest(formula = eq_1, data = main_df, listw = queen.TH76.listw, model="pooling", test = "rlml")
##
## Locally robust LM test for spatial lag dependence sub spatial error
##
## data: formula
## LM = 13.423, df = 1, p-value = 0.0002485
## alternative hypothesis: spatial lag dependence
bsktest(x = eq_1, data = main_df, listw = queen.TH76.listw, test = "LM1") # LM for random effect
##
## Baltagi, Song and Koh SLM1 marginal test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM1 = -2.6179, p-value = 1.991
## alternative hypothesis: Random effects
bsktest(x = eq_1, data = main_df, listw = queen.TH76.listw, test = "LM2") # LM for spatial error
##
## Baltagi, Song and Koh LM2 marginal test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM2 = 12.686, p-value < 2.2e-16
## alternative hypothesis: Spatial autocorrelation
bsktest(x = eq_1, data = main_df, listw = queen.TH76.listw, test = "LMH") # joint LM
##
## Baltagi, Song and Koh LM-H one-sided joint test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM-H = 160.94, p-value < 2.2e-16
## alternative hypothesis: Random Regional Effects and Spatial autocorrelation
bsktest(x = eq_1, data = main_df, listw = queen.TH76.listw, test = "CLMlambda") # test for spatial error
##
## Baltagi, Song and Koh LM*-lambda conditional LM test (assuming
## sigma^2_mu >= 0)
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM*-lambda = 12.029, p-value < 2.2e-16
## alternative hypothesis: Spatial autocorrelation
bsktest(x = eq_1, data = main_df, listw = queen.TH76.listw, test = "CLMmu") # test for random effect
##
## Baltagi, Song and Koh LM*- mu conditional LM test (assuming lambda may
## or may not be = 0)
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM*-mu = 2.8943, p-value = 0.003801
## alternative hypothesis: Random regional effects
# spatial Hausman test
sphtest(reg6, reg7) # rejcet H0 >> FE spatial lag is better
##
## Hausman test for spatial models
##
## data: eq_1
## chisq = 44.396, df = 8, p-value = 4.789e-07
## alternative hypothesis: one model is inconsistent
sphtest(reg8, reg9) # rejcet H0 >> FE spatial error is better
##
## Hausman test for spatial models
##
## data: eq_1
## chisq = 46.746, df = 8, p-value = 1.714e-07
## alternative hypothesis: one model is inconsistent
Result of the main rice
- Coefficient of the regressors are different, this is why we should
include the spatial effects into consideration.
summary(reg1)
## Pooling Model
##
## Call:
## plm(formula = eq_1, data = main_df, model = "pooling", index = c("ID",
## "year"))
##
## Balanced Panel: n = 76, T = 19, N = 1444
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -47.34512 -5.49285 -0.98261 4.01578 91.80665
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) -62.5468712 22.8500722 -2.7373 0.006272 **
## hy_half_share 0.0257145 0.0131657 1.9531 0.050996 .
## irri_p_land -0.0083232 0.0225334 -0.3694 0.711904
## log(temp) 16.7416904 6.8615010 2.4399 0.014810 *
## log(tpre) 2.1298387 1.6656166 1.2787 0.201206
## damage -0.4423133 0.0419070 -10.5546 < 2.2e-16 ***
## log(gpp_cvm_agri) 1.1680844 0.4603891 2.5372 0.011280 *
## log(gpp_cvm_indus) -0.1368482 0.3192035 -0.4287 0.668193
## log(gpp_cvm_ser) -0.0630511 0.4899998 -0.1287 0.897632
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 180470
## Residual Sum of Squares: 166790
## R-Squared: 0.075824
## Adj. R-Squared: 0.070672
## F-statistic: 14.7168 on 8 and 1435 DF, p-value: < 2.22e-16
summary(reg2)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = eq_1, data = main_df, effect = "individual", model = "within",
## index = c("ID", "year"))
##
## Balanced Panel: n = 76, T = 19, N = 1444
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -47.68590 -5.42909 -0.95905 4.03804 87.66420
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share 0.060535 0.031712 1.9089 0.05649 .
## irri_p_land -0.063354 0.039202 -1.6161 0.10630
## log(temp) -5.853767 22.131626 -0.2645 0.79144
## log(tpre) 1.710019 2.735987 0.6250 0.53207
## damage -0.627918 0.051685 -12.1489 < 2e-16 ***
## log(gpp_cvm_agri) 2.967474 1.761582 1.6845 0.09230 .
## log(gpp_cvm_indus) -0.573099 1.626805 -0.3523 0.72468
## log(gpp_cvm_ser) -0.197350 2.127662 -0.0928 0.92611
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 178000
## Residual Sum of Squares: 159570
## R-Squared: 0.10354
## Adj. R-Squared: 0.048832
## F-statistic: 19.6352 on 8 and 1360 DF, p-value: < 2.22e-16
summary(reg3)
## Oneway (individual) effect Random Effect Model
## (Wallace-Hussain's transformation)
##
## Call:
## plm(formula = eq_1, data = main_df, effect = "individual", model = "random",
## random.method = "walhus", index = c("ID", "year"))
##
## Balanced Panel: n = 76, T = 19, N = 1444
##
## Effects:
## var std.dev share
## idiosyncratic 118.15 10.87 1
## individual 0.00 0.00 0
## theta: 0
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -47.34512 -5.49285 -0.98261 4.01578 91.80665
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) -62.5468712 22.8500722 -2.7373 0.006195 **
## hy_half_share 0.0257145 0.0131657 1.9531 0.050802 .
## irri_p_land -0.0083232 0.0225334 -0.3694 0.711849
## log(temp) 16.7416904 6.8615010 2.4399 0.014689 *
## log(tpre) 2.1298387 1.6656166 1.2787 0.201000
## damage -0.4423133 0.0419070 -10.5546 < 2.2e-16 ***
## log(gpp_cvm_agri) 1.1680844 0.4603891 2.5372 0.011175 *
## log(gpp_cvm_indus) -0.1368482 0.3192035 -0.4287 0.668129
## log(gpp_cvm_ser) -0.0630511 0.4899998 -0.1287 0.897614
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 180470
## Residual Sum of Squares: 166790
## R-Squared: 0.075824
## Adj. R-Squared: 0.070672
## Chisq: 117.734 on 8 DF, p-value: < 2.22e-16
summary(reg6)
## Spatial panel fixed effects lag model
##
##
## Call:
## spml(formula = eq_1, data = main_df, index = c("ID", "year"),
## listw = queen.TH76.listw, model = "within", effect = "individual",
## lag = TRUE, spatial.error = "none")
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -44.88815 -4.92218 -0.77047 3.80581 99.72773
##
## Spatial autoregressive coefficient:
## Estimate Std. Error t-value Pr(>|t|)
## lambda 0.358987 0.030155 11.905 < 2.2e-16 ***
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share 0.052383 0.028916 1.8116 0.07005 .
## irri_p_land -0.051082 0.035737 -1.4294 0.15289
## log(temp) -10.533531 20.176853 -0.5221 0.60163
## log(tpre) 1.479205 2.494095 0.5931 0.55313
## damage -0.527151 0.047695 -11.0526 < 2e-16 ***
## log(gpp_cvm_agri) 2.713075 1.606615 1.6887 0.09128 .
## log(gpp_cvm_indus) -0.428676 1.482994 -0.2891 0.77253
## log(gpp_cvm_ser) -0.083710 1.939628 -0.0432 0.96558
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(reg8)
## Spatial panel fixed effects error model
##
##
## Call:
## spml(formula = eq_1, data = main_df, index = c("ID", "year"),
## listw = queen.TH76.listw, model = "within", effect = "individual",
## lag = FALSE, spatial.error = "b", quiet = TRUE)
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -48.02280 -5.40831 -0.98785 4.04028 87.99026
##
## Spatial error parameter:
## Estimate Std. Error t-value Pr(>|t|)
## rho 0.362171 0.031091 11.649 < 2.2e-16 ***
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share 0.061462 0.032610 1.8847 0.05946 .
## irri_p_land -0.052774 0.036866 -1.4315 0.15228
## log(temp) -13.165664 29.785517 -0.4420 0.65848
## log(tpre) 0.619905 3.464564 0.1789 0.85799
## damage -0.551342 0.051469 -10.7120 < 2e-16 ***
## log(gpp_cvm_agri) 3.319982 1.732438 1.9164 0.05532 .
## log(gpp_cvm_indus) -0.102942 1.585444 -0.0649 0.94823
## log(gpp_cvm_ser) 0.374705 2.298313 0.1630 0.87049
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Second rice
# pooled ols
regs1 <- plm(eq_1, data = second_df, index = c("ID", "year"), model = "pooling")
# fixed effect
regs2 <- plm(eq_1, data = second_df, index = c("ID", "year"), model = "within", effect = "individual")
# random effect
regs3 <- plm(eq_1, data = second_df, index = c("ID", "year"), model = "random",
random.method = "walhus", effect = "individual")
# pooled spatial lag
regs4 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "pooling", lag = TRUE, spatial.error = "none")
# pooled spatial error
regs5 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "pooling", lag = FALSE, spatial.error = "b")
# fixed effect spatial lag
regs6 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "within", effect = "individual",
lag = TRUE, spatial.error = "none")
# random effects spatial lag
regs7 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "random", lag = TRUE, spatial.error = "none")
# fixed effects spatial error
regs8 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "within", effect = "individual",
lag = FALSE, spatial.error = "b", quiet = TRUE)
# random effects spatial error
regs9 <- spml(formula = eq_1, data = second_df, index = c("ID", "year"),
listw = queen.TH60.listw, model = "random", lag = FALSE, spatial.error = "b")
Tests
#LM test for random effect VS OLS
plmtest(regs1) # not reject H0 >> OLS is better
##
## Lagrange Multiplier Test - (Honda)
##
## data: eq_1
## normal = -2.9021, p-value = 0.9981
## alternative hypothesis: significant effects
#LM test for fixed effect VS OLS
pFtest(regs2, regs1) # not reject H0 >> OLS is better
##
## F test for individual effects
##
## data: eq_1
## F = 0.59943, df1 = 59, df2 = 1372, p-value = 0.9931
## alternative hypothesis: significant effects
# Hausman Test for fixed effect VS random effect
# H0: alpha is not diff >> reject H0 >> use FE model
phtest(regs2, regs3) # reject H0 >> fixed effect is better
##
## Hausman Test
##
## data: eq_1
## chisq = 23.926, df = 8, p-value = 0.002358
## alternative hypothesis: one model is inconsistent
# spatial test
# moran I
iden_second <- diag(24)
mat_second <- listw2mat(queen.TH60.listw)
matpooled_second <- kronecker(iden_second, mat_second)
matpooled_secondlistw <- mat2listw(matpooled_second)
second_df_m <- second_df[order(second_df$year, second_df$ID),]
reg_second <- lm(eq_1, data = second_df_m)
lm.morantest(model = reg_second, listw = matpooled_secondlistw)
##
## Global Moran I for regression residuals
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## Moran I statistic standard deviate = 6.9864, p-value = 1.411e-12
## alternative hypothesis: greater
## sample estimates:
## Observed Moran I Expectation Variance
## 0.1311211345 -0.0028296716 0.0003676115
lm.LMtests(model = reg_second, listw = matpooled_secondlistw, test = "all")
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## LMerr = 46.465, df = 1, p-value = 9.328e-12
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## LMlag = 45.613, df = 1, p-value = 1.441e-11
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## RLMerr = 1.1522, df = 1, p-value = 0.2831
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## RLMlag = 0.30037, df = 1, p-value = 0.5837
##
##
## Lagrange multiplier diagnostics for spatial dependence
##
## data:
## model: lm(formula = eq_1, data = second_df_m)
## weights: matpooled_secondlistw
##
## SARMA = 46.765, df = 2, p-value = 7e-11
# Locally robust panel Lagrange Multiplier tests for spatial dependence
slmtest(formula = eq_1, data = second_df, listw = queen.TH60.listw, model="pooling", test = "lme") # reject H0 >> spatial error dependence
##
## LM test for spatial error dependence
##
## data: formula
## LM = 46.465, df = 1, p-value = 9.328e-12
## alternative hypothesis: spatial error dependence
slmtest(formula = eq_1, data = second_df, listw = queen.TH60.listw, model="pooling", test = "lml") # reject H0 >> spatial lag dependence
##
## LM test for spatial lag dependence
##
## data: formula
## LM = 45.613, df = 1, p-value = 1.441e-11
## alternative hypothesis: spatial lag dependence
slmtest(formula = eq_1, data = second_df, listw = queen.TH60.listw, model="pooling", test = "rlme")
##
## Locally robust LM test for spatial error dependence sub spatial lag
##
## data: formula
## LM = 1.1522, df = 1, p-value = 0.2831
## alternative hypothesis: spatial error dependence
slmtest(formula = eq_1, data = second_df, listw = queen.TH60.listw, model="pooling", test = "rlml")
##
## Locally robust LM test for spatial lag dependence sub spatial error
##
## data: formula
## LM = 0.30037, df = 1, p-value = 0.5837
## alternative hypothesis: spatial lag dependence
bsktest(x = eq_1, data = second_df, listw = queen.TH60.listw, test = "LM1") # LM for random effect
##
## Baltagi, Song and Koh SLM1 marginal test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM1 = -2.9021, p-value = 1.996
## alternative hypothesis: Random effects
bsktest(x = eq_1, data = second_df, listw = queen.TH60.listw, test = "LM2") # LM for spatial error
##
## Baltagi, Song and Koh LM2 marginal test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM2 = 6.8165, p-value = 9.328e-12
## alternative hypothesis: Spatial autocorrelation
bsktest(x = eq_1, data = second_df, listw = queen.TH60.listw, test = "LMH") # joint LM
##
## Baltagi, Song and Koh LM-H one-sided joint test
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM-H = 46.465, p-value = 2.5e-11
## alternative hypothesis: Random Regional Effects and Spatial autocorrelation
#bsktest(x = eq_1, data = second_df, listw = queen.TH60.listw, test = "CLMlambda") # test for spatial error
bsktest(x = eq_1, data = second_df, listw = queen.TH60.listw, test = "CLMmu") # test for random effect
##
## Baltagi, Song and Koh LM*- mu conditional LM test (assuming lambda may
## or may not be = 0)
##
## data: tfp_g ~ hy_half_share + irri_p_land + log(temp) + log(tpre) + damage + log(gpp_cvm_agri) + log(gpp_cvm_indus) + log(gpp_cvm_ser)
## LM*-mu = 3.118, p-value = 0.001821
## alternative hypothesis: Random regional effects
# spatial Hausman test
sphtest(regs6, regs7) # rejcet H0 >> FE spatial lag is better
##
## Hausman test for spatial models
##
## data: eq_1
## chisq = 25.609, df = 8, p-value = 0.001225
## alternative hypothesis: one model is inconsistent
sphtest(regs8, regs9) # rejcet H0 >> FE spatial error is better
##
## Hausman test for spatial models
##
## data: eq_1
## chisq = 29.013, df = 8, p-value = 0.0003155
## alternative hypothesis: one model is inconsistent
Result of the second rice
summary(regs1)
## Pooling Model
##
## Call:
## plm(formula = eq_1, data = second_df, model = "pooling", index = c("ID",
## "year"))
##
## Balanced Panel: n = 60, T = 24, N = 1440
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -52.2080 -5.2033 -0.7881 3.9492 94.8038
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) -28.7297226 16.2360841 -1.7695 0.07702 .
## hy_half_share -0.0094057 0.0156499 -0.6010 0.54793
## irri_p_land 0.0119751 0.0018088 6.6206 5.046e-11 ***
## log(temp) 7.4018725 4.8657703 1.5212 0.12843
## log(tpre) -1.0421757 0.6537185 -1.5942 0.11111
## damage -0.9483057 0.0895441 -10.5904 < 2.2e-16 ***
## log(gpp_cvm_agri) 0.9203406 0.4829664 1.9056 0.05690 .
## log(gpp_cvm_indus) -0.1563359 0.3347778 -0.4670 0.64058
## log(gpp_cvm_ser) -0.1531876 0.5156794 -0.2971 0.76646
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 221210
## Residual Sum of Squares: 199770
## R-Squared: 0.096945
## Adj. R-Squared: 0.091897
## F-statistic: 19.2027 on 8 and 1431 DF, p-value: < 2.22e-16
summary(regs2)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = eq_1, data = second_df, effect = "individual",
## model = "within", index = c("ID", "year"))
##
## Balanced Panel: n = 60, T = 24, N = 1440
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -51.35066 -5.01396 -0.77282 4.14941 90.80310
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share -0.0101276 0.0228841 -0.4426 0.6582
## irri_p_land 0.0134042 0.0019844 6.7548 2.106e-11 ***
## log(temp) 10.7180768 14.8121409 0.7236 0.4694
## log(tpre) -1.8793770 1.2077385 -1.5561 0.1199
## damage -1.0553153 0.0967905 -10.9031 < 2.2e-16 ***
## log(gpp_cvm_agri) 1.9614205 1.6581398 1.1829 0.2371
## log(gpp_cvm_indus) -1.3691797 1.5133087 -0.9048 0.3658
## log(gpp_cvm_ser) -1.7671378 2.0503153 -0.8619 0.3889
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 219620
## Residual Sum of Squares: 194750
## R-Squared: 0.11324
## Adj. R-Squared: 0.069938
## F-statistic: 21.901 on 8 and 1372 DF, p-value: < 2.22e-16
summary(regs3)
## Oneway (individual) effect Random Effect Model
## (Wallace-Hussain's transformation)
##
## Call:
## plm(formula = eq_1, data = second_df, effect = "individual",
## model = "random", random.method = "walhus", index = c("ID",
## "year"))
##
## Balanced Panel: n = 60, T = 24, N = 1440
##
## Effects:
## var std.dev share
## idiosyncratic 141.86 11.91 1
## individual 0.00 0.00 0
## theta: 0
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -52.2080 -5.2033 -0.7881 3.9492 94.8038
##
## Coefficients:
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept) -28.7297226 16.2360841 -1.7695 0.07681 .
## hy_half_share -0.0094057 0.0156499 -0.6010 0.54784
## irri_p_land 0.0119751 0.0018088 6.6206 3.578e-11 ***
## log(temp) 7.4018725 4.8657703 1.5212 0.12821
## log(tpre) -1.0421757 0.6537185 -1.5942 0.11089
## damage -0.9483057 0.0895441 -10.5904 < 2.2e-16 ***
## log(gpp_cvm_agri) 0.9203406 0.4829664 1.9056 0.05670 .
## log(gpp_cvm_indus) -0.1563359 0.3347778 -0.4670 0.64051
## log(gpp_cvm_ser) -0.1531876 0.5156794 -0.2971 0.76642
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 221210
## Residual Sum of Squares: 199770
## R-Squared: 0.096945
## Adj. R-Squared: 0.091897
## Chisq: 153.621 on 8 DF, p-value: < 2.22e-16
summary(regs6)
## Spatial panel fixed effects lag model
##
##
## Call:
## spml(formula = eq_1, data = second_df, index = c("ID", "year"),
## listw = queen.TH60.listw, model = "within", effect = "individual",
## lag = TRUE, spatial.error = "none")
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -48.87288 -4.63305 -0.71071 3.83415 89.66232
##
## Spatial autoregressive coefficient:
## Estimate Std. Error t-value Pr(>|t|)
## lambda 0.184868 0.032629 5.6657 1.464e-08 ***
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share -0.0061542 0.0219744 -0.2801 0.7794
## irri_p_land 0.0132662 0.0019067 6.9578 3.456e-12 ***
## log(temp) 9.9561360 14.2248670 0.6999 0.4840
## log(tpre) -1.3417159 1.1634480 -1.1532 0.2488
## damage -1.0117728 0.0931341 -10.8636 < 2.2e-16 ***
## log(gpp_cvm_agri) 1.6048926 1.5926754 1.0077 0.3136
## log(gpp_cvm_indus) -0.9998154 1.4531535 -0.6880 0.4914
## log(gpp_cvm_ser) -1.5982940 1.9695789 -0.8115 0.4171
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(regs8)
## Spatial panel fixed effects error model
##
##
## Call:
## spml(formula = eq_1, data = second_df, index = c("ID", "year"),
## listw = queen.TH60.listw, model = "within", effect = "individual",
## lag = FALSE, spatial.error = "b", quiet = TRUE)
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -50.9239 -5.0076 -0.7479 4.2088 91.0853
##
## Spatial error parameter:
## Estimate Std. Error t-value Pr(>|t|)
## rho 0.193253 0.033513 5.7664 8.096e-09 ***
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## hy_half_share -0.0010345 0.0235059 -0.0440 0.9649
## irri_p_land 0.0136767 0.0019252 7.1040 1.212e-12 ***
## log(temp) 12.5872123 17.2610302 0.7292 0.4659
## log(tpre) -1.8090197 1.3869251 -1.3043 0.1921
## damage -1.0236948 0.0941451 -10.8736 < 2.2e-16 ***
## log(gpp_cvm_agri) 1.7844062 1.6590669 1.0755 0.2821
## log(gpp_cvm_indus) -0.6391294 1.5033999 -0.4251 0.6707
## log(gpp_cvm_ser) -2.0053501 2.1414263 -0.9365 0.3490
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1