Data Input merupakan file excel berformat (.xlsx) yang berisi data PDRB Perkapita, Indeks Pembangunan Manusia (IPM), dan Tingkat Penganggran Terbuka.
library(openxlsx)
dt2 <- read.xlsx('datapanel.xlsx')
library(DT)
datatable(dt2)
library(plm)
library(ggplot2)
ggplot(dt2,aes(x=Tahun,PDRB.Perkapita, color=Wilayah)) +
geom_line() + geom_point() +
theme_bw() + ggtitle('PDRB Perkapita Menurut Kabupaten/Kota di Prov. Jambi, 2017-2021')
ggplot(dt2,aes(x=Tahun,IPM, color=Wilayah)) +
geom_line() + geom_point() +
theme_bw() + ggtitle('IPM Menurut Kabupaten/Kota di Prov. Jambi, 2017-2021')
ggplot(dt2,aes(x=Tahun,TPT, color=Wilayah)) +
geom_line() + geom_point() +
theme_bw() + ggtitle('TPT Menurut Kabupaten/Kota di Prov. Jambi, 2017-2021') + ylab('TPT (%)')
ggplot(dt2,aes(x=Tahun,Miskin, color=Wilayah)) +
geom_line() + geom_point() +
theme_bw() + ggtitle('Persentase Penduduk Miskin Menurut Kabupaten/Kota di Prov. Jambi, 2017-2021') + ylab('Persentase Penduduk Miskin (%)')
library(GGally)
ggpairs(dt2[,3:6]) +
theme_bw()
pooled_ols_plm <- plm(IPM~log(PDRB.Perkapita)+TPT+Miskin+Gini.Ratio+Gini.Ratio, data = dt2,
index = c("Wilayah", "Tahun"), model = "pooling")
summary(pooled_ols_plm)
Pooling Model
Call:
plm(formula = IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio +
Gini.Ratio, data = dt2, model = "pooling", index = c("Wilayah",
"Tahun"))
Balanced Panel: n = 11, T = 5, N = 55
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-5.216298 -1.530291 -0.062151 1.295367 5.054062
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
(Intercept) 62.42312 5.70811 10.9359 7.274e-15 ***
log(PDRB.Perkapita) -0.33219 0.96521 -0.3442 0.732165
TPT 0.99043 0.20219 4.8984 1.055e-05 ***
Miskin -0.36687 0.13210 -2.7772 0.007698 **
Gini.Ratio 25.69335 12.62201 2.0356 0.047107 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 711.69
Residual Sum of Squares: 284.99
R-Squared: 0.59956
Adj. R-Squared: 0.56753
F-statistic: 18.7159 on 4 and 50 DF, p-value: 1.85e-09
fe_model_plm <- plm(IPM~log(PDRB.Perkapita)+TPT+Miskin+Gini.Ratio+Gini.Ratio, data = dt2,
index = c("Wilayah", "Tahun"),
effect = "individual", model = "within")
summary(fe_model_plm)
Oneway (individual) effect Within Model
Call:
plm(formula = IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio +
Gini.Ratio, data = dt2, effect = "individual", model = "within",
index = c("Wilayah", "Tahun"))
Balanced Panel: n = 11, T = 5, N = 55
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-0.915689 -0.241169 -0.071658 0.238912 1.008779
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
log(PDRB.Perkapita) 4.229359 0.782496 5.4050 3.233e-06 ***
TPT 0.106246 0.069091 1.5378 0.1319777
Miskin -0.699710 0.194104 -3.6048 0.0008559 ***
Gini.Ratio -3.621335 2.859948 -1.2662 0.2127576
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 18.641
Residual Sum of Squares: 8.0556
R-Squared: 0.56786
Adj. R-Squared: 0.41661
F-statistic: 13.1407 on 4 and 40 DF, p-value: 6.3737e-07
fixef(fe_model_plm)
BATANGHARI BUNGO KERINCI
60.039 58.011 61.034
KOTA JAMBI KOTA SUNGAI PENUH MERANGIN
67.932 59.263 60.167
MUARO JAMBI SAROLANGUN TANJUNG JABUNG BARAT
55.089 59.798 55.303
TANJUNG JABUNG TIMUR TEBO
53.402 58.382
re_model_plm <- plm(IPM~log(PDRB.Perkapita)+TPT+Miskin+Gini.Ratio+Gini.Ratio, data = dt2,
index = c("Wilayah", "Tahun"),
effect = "individual", model = "random")
summary(re_model_plm)
Oneway (individual) effect Random Effect Model
(Swamy-Arora's transformation)
Call:
plm(formula = IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio +
Gini.Ratio, data = dt2, effect = "individual", model = "random",
index = c("Wilayah", "Tahun"))
Balanced Panel: n = 11, T = 5, N = 55
Effects:
var std.dev share
idiosyncratic 0.2014 0.4488 0.032
individual 6.1337 2.4766 0.968
theta: 0.9192
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-1.026329 -0.229023 -0.048265 0.286270 1.515741
Coefficients:
Estimate Std. Error z-value Pr(>|z|)
(Intercept) 61.65901 3.57213 17.2611 < 2.2e-16 ***
log(PDRB.Perkapita) 3.45872 0.82277 4.2038 2.625e-05 ***
TPT 0.15978 0.07541 2.1189 0.0341 *
Miskin -0.71354 0.18079 -3.9469 7.918e-05 ***
Gini.Ratio -2.58469 3.16024 -0.8179 0.4134
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 23.163
Residual Sum of Squares: 12.598
R-Squared: 0.4561
Adj. R-Squared: 0.41258
Chisq: 41.928 on 4 DF, p-value: 1.7265e-08
plmtest(pooled_ols_plm, effect = "individual", type = c("bp"))
Lagrange Multiplier Test - (Breusch-Pagan)
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
chisq = 60.955, df = 1, p-value = 5.841e-15
alternative hypothesis: significant effects
Random Effect lebih baik dibanding Pooled
phtest(re_model_plm,fe_model_plm)
Hausman Test
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
chisq = 9.8392, df = 4, p-value = 0.04323
alternative hypothesis: one model is inconsistent
Fixed Effect lebih baik dibanding Random Effect
pcdtest(fe_model_plm, test = c("lm"))
Breusch-Pagan LM test for cross-sectional dependence in
panels
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
chisq = 100.99, df = 55, p-value = 0.0001561
alternative hypothesis: cross-sectional dependence
pcdtest(fe_model_plm, test = c("cd"))
Pesaran CD test for cross-sectional dependence in
panels
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
z = 3.3215, p-value = 0.0008954
alternative hypothesis: cross-sectional dependence
pbgtest(fe_model_plm)
Breusch-Godfrey/Wooldridge test for serial correlation
in panel models
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
chisq = 11.072, df = 5, p-value = 0.04997
alternative hypothesis: serial correlation in idiosyncratic errors
library(lmtest)
library(tseries)
pdwtest(fe_model_plm)
Durbin-Watson test for serial correlation in panel
models
data: IPM ~ log(PDRB.Perkapita) + TPT + Miskin + Gini.Ratio + Gini.Ratio
DW = 1.7505, p-value = 0.162
alternative hypothesis: serial correlation in idiosyncratic errors
bptest(fe_model_plm, studentize = F)
Breusch-Pagan test
data: fe_model_plm
BP = 9.0248, df = 4, p-value = 0.06048
library(car)
vif(pooled_ols_plm)
log(PDRB.Perkapita) TPT Miskin
1.174486 1.375883 1.160777
Gini.Ratio
1.329677