Persamaan Simultan 3SLS
Berkas Analisis Persamaan Simultan 3SLS
Skripsiku
Model persamaan simultan merupakan model yang terdiri dari lebih dari satu persamaan regresi yang saling memiliki keterkaitan antara satu dengan lainnya (Gujarati & Porter, 2009). Model persamaan simultan terdiri dari persamaan struktural yang dibangun atas teori ekonomi dimana variabel terikat dalam satu atau lebih persamaan pada saat yang sama merupakan variabel bebas untuk persamaan lainnya. Persamaan simultan mengindikasikan terdapat hubungan dua arah (simultan) antara variabel dependen dan independen. Model persamaan simultan melibatkan lebih dari satu variabel dependen atau endogen sehingga membutuhkan persamaan dengan jumlah sebanyak variabel endogen.
Load Data
library(readxl)
data <- read_excel("F:/Berkas Skripsi/A. SkripsiQ/Dataset/Data_Skripsi.xlsx",
sheet = "Final")
head(data,10)## # A tibble: 10 x 12
## Year dLNG dPE dAHH INF dLNKURS IR dLNLF dM2 dUNEM
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2000 NA NA NA 9.35 NA 14.5 NA NA NA
## 2 2001 -0.0411 -1.28 0.265 12.6 -0.198 17.6 0.00780 -4.75 0
## 3 2002 -0.184 0.85 0.284 10.0 0.0971 12.9 -0.00103 -7.11 0.520
## 4 2003 -0.122 0.29 0.310 5.06 0.0821 8.31 0.0109 3.18 0.0600
## 5 2004 0.172 0.25 0.338 6.4 -0.0413 7.43 0.0152 1.21 0.640
## 6 2005 0.0641 0.66 0.365 17.1 -0.0822 12.8 -0.00451 7.19 0.640
## 7 2006 -0.137 -0.190 0.383 6.6 0.0578 9.75 0.0155 -1.39 -0.390
## 8 2007 0.00192 0.84 0.388 6.59 0.00200 8 0.0481 4.38 0.510
## 9 2008 -0.0591 -0.33 0.380 11.1 -0.0592 9.25 0.0182 -4.40 -0.850
## 10 2009 -0.0945 -1.39 0.368 2.78 -0.0688 6.5 0.0103 -1.97 -1.10
## # ... with 2 more variables: lagINF <dbl>, dgr <dbl>
#data
awal <- read_excel("F:/Berkas Skripsi/A. SkripsiQ/Dataset/Data_Skripsi.xlsx",
sheet = "New_era")
head(awal,10)## # A tibble: 10 x 21
## Year G PE AHH INF KURS IR LF M2 UNEM ...11 dlngg
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl> <dbl>
## 1 2000 60.4 4.92 65.8 9.35 1.19e-4 14.5 9.93e7 16.6 6.08 NA NA
## 2 2001 58.0 3.64 66.0 12.6 9.75e-5 17.6 1.00e8 11.9 6.08 NA -0.0411
## 3 2002 48.3 4.49 66.3 10.0 1.07e-4 12.9 1.00e8 4.76 6.60 NA -0.184
## 4 2003 42.7 4.78 66.6 5.06 1.17e-4 8.31 1.01e8 7.94 6.66 NA -0.122
## 5 2004 50.7 5.03 67.0 6.4 1.12e-4 7.43 1.03e8 9.14 7.30 NA 0.172
## 6 2005 54.1 5.69 67.3 17.1 1.03e-4 12.8 1.02e8 16.3 7.94 NA 0.0641
## 7 2006 47.1 5.5 67.7 6.6 1.09e-4 9.75 1.04e8 14.9 7.55 NA -0.137
## 8 2007 47.2 6.34 68.1 6.59 1.09e-4 8 1.09e8 19.3 8.06 NA 0.00192
## 9 2008 44.5 6.01 68.5 11.1 1.03e-4 9.25 1.11e8 14.9 7.21 NA -0.0591
## 10 2009 40.5 4.62 68.9 2.78 9.62e-5 6.5 1.12e8 13.0 6.11 NA -0.0945
## # ... with 9 more variables: dpe1 <dbl>, dahh <dbl>, inf <dbl>, dlnkurs <dbl>,
## # ir <dbl>, dlf <dbl>, dm2 <dbl>, dunem <dbl>, lagINF <dbl>
Spesifikasi Model dan Identifikasi Variabel
#Persamaan Struktural
G <- dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF
PE <- dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF
AHH <- dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF + INF
#Identifikasi Sistem Simultan
sys <- list(G, PE, AHH)
#Variabel predetermined
instr <- ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINFUji Stasioner
#Uji Stasioneritas
library(tseries)
adf.test(diff(log(awal$G)),k=3)##
## Augmented Dickey-Fuller Test
##
## data: diff(log(awal$G))
## Dickey-Fuller = -2.7988, Lag order = 3, p-value = 0.2681
## alternative hypothesis: stationary
#di Eviews --> merupakan trend and intercept dengan AKAIKE -> kurang bervariasi -> pakai Eviews ajaPersamaan Regresi Tereduksi (Reduced Form)
Globalisasi Ekonomi Tereduksi
rf_g <- lm(dLNG ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
,data=data)
summary(rf_g)##
## Call:
## lm(formula = dLNG ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 +
## lagINF, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.051115 -0.019206 -0.010046 0.006732 0.121241
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.075707 0.055617 1.361 0.2007
## INF 0.004394 0.007006 0.627 0.5433
## IR -0.011029 0.009666 -1.141 0.2781
## dLNKURS -0.462383 0.164821 -2.805 0.0171 *
## dLNLF 0.350738 1.326335 0.264 0.7963
## dUNEM 0.047286 0.026183 1.806 0.0983 .
## dM2 0.006038 0.004626 1.305 0.2185
## lagINF -0.006526 0.004639 -1.407 0.1871
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05253 on 11 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.7361, Adjusted R-squared: 0.5682
## F-statistic: 4.383 on 7 and 11 DF, p-value: 0.01479
res_rf_g = residuals(rf_g)
res_rf_g=data.frame(res_rf_g)
fit_rf_g = fitted.values(rf_g)
#Uji Asumsi Klasik
#normalitas -> ga terpenuhi
library(nortest)
lillie.test(res_rf_g$res_rf_g)##
## Lilliefors (Kolmogorov-Smirnov) normality test
##
## data: res_rf_g$res_rf_g
## D = 0.20004, p-value = 0.04393
#Homoskedastisitas
library(nortsTest)
arch.test(res_rf_g$res_rf_g,arch = c("box","Lm"),alpha = 0.05,lag.max = 3)##
## Box-Ljung test
##
## data: y^2
## X-squared = 0.61774, df = 3, p-value = 0.8924
## alternative hypothesis: y is heteroscedastic
#Non-Autokorelasi
library(lmtest)
dwtest(rf_g)##
## Durbin-Watson test
##
## data: rf_g
## DW = 2.457, p-value = 0.7306
## alternative hypothesis: true autocorrelation is greater than 0
#non multikol
library(car)
vif(rf_g)## INF IR dLNKURS dLNLF dUNEM dM2 lagINF
## 4.865387 6.638818 1.289722 1.548669 1.355334 1.603372 2.054128
Pertumbuhan Ekonomi Tereduksi
rf_pe <- lm(dPE ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
,data=data)
summary(rf_pe)##
## Call:
## lm(formula = dPE ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 +
## lagINF, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.19928 -0.14602 -0.03913 0.05547 0.46740
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.284602 0.261427 1.089 0.299586
## INF 0.093461 0.032931 2.838 0.016139 *
## IR -0.057903 0.045432 -1.274 0.228754
## dLNKURS 6.548807 0.774735 8.453 3.85e-06 ***
## dLNLF 9.931700 6.234386 1.593 0.139456
## dUNEM 0.580723 0.123070 4.719 0.000631 ***
## dM2 -0.004453 0.021744 -0.205 0.841490
## lagINF -0.049375 0.021803 -2.265 0.044734 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2469 on 11 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.9248, Adjusted R-squared: 0.877
## F-statistic: 19.33 on 7 and 11 DF, p-value: 2.355e-05
res_rf_pe = residuals(rf_pe)
fit_rf_pe = fitted.values(rf_pe)
#Uji Asumsi Klasik
#Normalitas
library(nortest)
lillie.test(res_rf_pe)##
## Lilliefors (Kolmogorov-Smirnov) normality test
##
## data: res_rf_pe
## D = 0.16427, p-value = 0.1943
#Homoskedastisitas
library(nortsTest)
arch.test(res_rf_pe,arch = c("box","Lm"),alpha = 0.05,lag.max = 3)##
## Box-Ljung test
##
## data: y^2
## X-squared = 0.81816, df = 3, p-value = 0.8451
## alternative hypothesis: y is heteroscedastic
#Non-autokorelasi
dwtest(rf_pe)##
## Durbin-Watson test
##
## data: rf_pe
## DW = 2.3591, p-value = 0.6553
## alternative hypothesis: true autocorrelation is greater than 0
#non multikol
library(car)
vif(rf_pe)## INF IR dLNKURS dLNLF dUNEM dM2 lagINF
## 4.865387 6.638818 1.289722 1.548669 1.355334 1.603372 2.054128
Angka harapan hidup tereduksi
rf_ahh <- lm(dAHH ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
,data=data)
summary(rf_ahh)##
## Call:
## lm(formula = dAHH ~ INF + IR + dLNKURS + dLNLF + dUNEM + dM2 +
## lagINF, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.074408 -0.016423 0.004651 0.021885 0.050060
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.214577 0.044868 4.782 0.000569 ***
## INF 0.014091 0.005652 2.493 0.029866 *
## IR -0.012305 0.007797 -1.578 0.142847
## dLNKURS -0.008103 0.132966 -0.061 0.952499
## dLNLF 1.708806 1.069996 1.597 0.138567
## dUNEM -0.018424 0.021122 -0.872 0.401702
## dM2 0.004287 0.003732 1.149 0.275001
## lagINF 0.010858 0.003742 2.902 0.014402 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04238 on 11 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.6247, Adjusted R-squared: 0.3859
## F-statistic: 2.616 on 7 and 11 DF, p-value: 0.07466
res_rf_ahh = residuals(rf_ahh)
fit_rf_ahh = fitted.values(rf_ahh)
#Uji Asumsi Klasik
#Normalitas
lillie.test(res_rf_ahh)##
## Lilliefors (Kolmogorov-Smirnov) normality test
##
## data: res_rf_ahh
## D = 0.15621, p-value = 0.2571
#Homoskedastisitas
library(nortsTest)
arch.test(res_rf_ahh,arch = c("box","Lm"),alpha = 0.05,lag.max = 3)##
## Box-Ljung test
##
## data: y^2
## X-squared = 0.76724, df = 3, p-value = 0.8573
## alternative hypothesis: y is heteroscedastic
#non-autokorelasi -> ga terpenuhi
dwtest(rf_ahh)##
## Durbin-Watson test
##
## data: rf_ahh
## DW = 1.2823, p-value = 0.01931
## alternative hypothesis: true autocorrelation is greater than 0
dwtest(rf_ahh,exact = TRUE,alternative = "two.sided",iterations = 1)##
## Durbin-Watson test
##
## data: rf_ahh
## DW = 1.2823, p-value = 0.03729
## alternative hypothesis: true autocorrelation is not 0
#non multikol
library(car)
vif(rf_ahh)## INF IR dLNKURS dLNLF dUNEM dM2 lagINF
## 4.865387 6.638818 1.289722 1.548669 1.355334 1.603372 2.054128
Uji Endogenitas dan Simultanitas Pindyx | Gujarati
fit_rf_g=data.frame(fit_rf_g)
fit_rf_ahh=data.frame(fit_rf_ahh)
fit_rf_pe=data.frame(fit_rf_pe)
fit = data.frame(fit_rf_g,fit_rf_pe,fit_rf_ahh)
residual = data.frame(res_rf_g,res_rf_pe,res_rf_ahh)
#Penyatuan dataset
library(openxlsx)
library(expss)
#Import data
#write.xlsx(fit,file = "fitted_rf.xlsx")
#write.xlsx(residual,file = "res_rf.xlsx")
#Endogenitas 1
endogen <- read_excel("F:/Berkas Skripsi/A. SkripsiQ/Dataset/Pengolahan Data/New/fitted_rf.xlsx")
end_g <- lm(dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF + res_rf_pe + res_rf_ahh
,data=endogen)
summary(end_g)##
## Call:
## lm(formula = dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF +
## res_rf_pe + res_rf_ahh, data = endogen)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.065445 -0.032363 -0.002963 0.022121 0.083343
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.008443 0.134544 0.063 0.9512
## dPE 0.117435 0.049717 2.362 0.0398 *
## dAHH 0.180417 0.513174 0.352 0.7325
## INF -0.003588 0.011991 -0.299 0.7709
## IR -0.010409 0.008604 -1.210 0.2542
## dLNKURS -1.215746 0.389387 -3.122 0.0108 *
## dLNLF -0.688878 1.840174 -0.374 0.7160
## res_rf_pe -0.187643 0.083895 -2.237 0.0493 *
## res_rf_ahh 0.261717 0.646821 0.405 0.6943
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05451 on 10 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.7417, Adjusted R-squared: 0.535
## F-statistic: 3.588 on 8 and 10 DF, p-value: 0.03135
end_pe<-lm(dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF + res_rf_g+res_rf_ahh,
data=endogen)
summary(end_pe)##
## Call:
## lm(formula = dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF +
## res_rf_g + res_rf_ahh, data = endogen)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.34374 -0.14591 0.02324 0.14504 0.56830
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.22401 0.70301 0.319 0.75656
## dLNG 7.01697 2.26961 3.092 0.01141 *
## dAHH -2.08507 2.74811 -0.759 0.46552
## dM2 -0.03643 0.04122 -0.884 0.39759
## dLNLF 9.95646 8.52191 1.168 0.26977
## dLNKURS 9.92969 1.36171 7.292 2.63e-05 ***
## INF 0.10036 0.02703 3.714 0.00402 **
## res_rf_g -8.67058 2.86558 -3.026 0.01277 *
## res_rf_ahh 3.70456 3.50065 1.058 0.31483
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2908 on 10 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.9052, Adjusted R-squared: 0.8294
## F-statistic: 11.94 on 8 and 10 DF, p-value: 0.0003349
end_ahh <- lm(dAHH ~ fit_rf_g + fit_rf_pe + lagINF + dUNEM + dLNLF + INF + res_rf_g+res_rf_pe,
data=endogen)
summary(end_ahh)##
## Call:
## lm(formula = dAHH ~ fit_rf_g + fit_rf_pe + lagINF + dUNEM + dLNLF +
## INF + res_rf_g + res_rf_pe, data = endogen)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.064525 -0.017248 0.008513 0.018252 0.048394
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.138592 0.044405 3.121 0.01085 *
## fit_rf_g 0.788294 0.318045 2.479 0.03262 *
## fit_rf_pe 0.054498 0.021663 2.516 0.03061 *
## lagINF 0.018597 0.005506 3.378 0.00703 **
## dUNEM -0.087968 0.029750 -2.957 0.01436 *
## dLNLF 0.878745 1.091291 0.805 0.43941
## INF 0.005239 0.003165 1.655 0.12889
## res_rf_g 0.300872 0.242962 1.238 0.24387
## res_rf_pe 0.046790 0.051689 0.905 0.38664
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04077 on 10 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.6842, Adjusted R-squared: 0.4315
## F-statistic: 2.708 on 8 and 10 DF, p-value: 0.07118
exo_pe <- end_pe<-lm(dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF + fit_rf_g+fit_rf_ahh,
data=endogen)
summary(exo_pe)##
## Call:
## lm(formula = dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF +
## fit_rf_g + fit_rf_ahh, data = endogen)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.34374 -0.14591 0.02324 0.14504 0.56830
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.22401 0.70301 0.319 0.75656
## dLNG -1.65361 1.74941 -0.945 0.36681
## dAHH 1.61949 2.16851 0.747 0.47237
## dM2 -0.03643 0.04122 -0.884 0.39759
## dLNLF 9.95646 8.52191 1.168 0.26977
## dLNKURS 9.92969 1.36171 7.292 2.63e-05 ***
## INF 0.10036 0.02703 3.714 0.00402 **
## fit_rf_g 8.67058 2.86558 3.026 0.01277 *
## fit_rf_ahh -3.70456 3.50065 -1.058 0.31483
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2908 on 10 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.9052, Adjusted R-squared: 0.8294
## F-statistic: 11.94 on 8 and 10 DF, p-value: 0.0003349
Pendugaan 2SLS dan DWH Simultanitas Test
#Pendugaan secara sistem antara 2SLS dan 3SLS
library(systemfit)
ive3_sem <- systemfit(sys, inst=instr, method="3SLS",data=data)
ive2_sem <- systemfit(sys, inst=instr, method="2SLS", data=data)
summary(ive2_sem)##
## systemfit results
## method: 2SLS
##
## N DF SSR detRCov OLS-R2 McElroy-R2
## system 57 36 3.00318 0 0.669528 0.929483
##
## N DF SSR MSE RMSE R2 Adj R2
## eq1 19 12 0.052728 0.004394 0.066287 0.541544 0.312315
## eq2 19 12 2.926860 0.243905 0.493867 0.671872 0.507808
## eq3 19 12 0.023589 0.001966 0.044337 0.551889 0.327834
##
## The covariance matrix of the residuals
## eq1 eq2 eq3
## eq1 0.00439401 -0.0303649 -0.00155122
## eq2 -0.03036493 0.2439050 0.01185086
## eq3 -0.00155122 0.0118509 0.00196573
##
## The correlations of the residuals
## eq1 eq2 eq3
## eq1 1.000000 -0.927537 -0.527815
## eq2 -0.927537 1.000000 0.541225
## eq3 -0.527815 0.541225 1.000000
##
##
## 2SLS estimates for 'eq1' (equation 1)
## Model Formula: dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.00844298 0.16361491 0.05160 0.959694
## dPE 0.11743538 0.06045867 1.94241 0.075925 .
## dAHH 0.18041656 0.62405285 0.28910 0.777435
## INF -0.00358823 0.01458193 -0.24607 0.809784
## IR -0.01040891 0.01046339 -0.99479 0.339474
## dLNKURS -1.21574583 0.47352073 -2.56746 0.024661 *
## dLNLF -0.68887850 2.23777325 -0.30784 0.763481
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.066287 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 0.052728 MSE: 0.004394 Root MSE: 0.066287
## Multiple R-Squared: 0.541544 Adjusted R-Squared: 0.312315
##
##
## 2SLS estimates for 'eq2' (equation 2)
## Model Formula: dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.2240078 1.1940808 0.18760 0.8543261
## dLNG 7.0169740 3.8549688 1.82024 0.0937391 .
## dAHH -2.0850699 4.6676981 -0.44670 0.6630451
## dM2 -0.0364295 0.0700160 -0.52030 0.6123176
## dLNLF 9.9564599 14.4745839 0.68786 0.5046214
## dLNKURS 9.9296946 2.3128876 4.29320 0.0010444 **
## INF 0.1003648 0.0459041 2.18640 0.0493251 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.493867 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 2.92686 MSE: 0.243905 Root MSE: 0.493867
## Multiple R-Squared: 0.671872 Adjusted R-Squared: 0.507808
##
##
## 2SLS estimates for 'eq3' (equation 3)
## Model Formula: dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF + INF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.13859182 0.04828406 2.87034 0.0140808 *
## dLNG 0.78829352 0.34582847 2.27944 0.0417208 *
## dPE 0.05449763 0.02355540 2.31359 0.0392200 *
## lagINF 0.01859708 0.00598708 3.10620 0.0090847 **
## dUNEM -0.08796790 0.03234845 -2.71938 0.0186290 *
## dLNLF 0.87874451 1.18662361 0.74054 0.4732129
## INF 0.00523894 0.00344168 1.52220 0.1538647
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.044337 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 0.023589 MSE: 0.001966 Root MSE: 0.044337
## Multiple R-Squared: 0.551889 Adjusted R-Squared: 0.327834
summary(ive3_sem)##
## systemfit results
## method: 3SLS
##
## N DF SSR detRCov OLS-R2 McElroy-R2
## system 57 36 2.65516 0 0.707823 0.988629
##
## N DF SSR MSE RMSE R2 Adj R2
## eq1 19 12 0.065603 0.005467 0.073938 0.429603 0.144404
## eq2 19 12 2.564186 0.213682 0.462258 0.712531 0.568797
## eq3 19 12 0.025374 0.002115 0.045984 0.517971 0.276956
##
## The covariance matrix of the residuals used for estimation
## eq1 eq2 eq3
## eq1 0.00439401 -0.0303649 -0.00155122
## eq2 -0.03036493 0.2439050 0.01185086
## eq3 -0.00155122 0.0118509 0.00196573
##
## The covariance matrix of the residuals
## eq1 eq2 eq3
## eq1 0.00546690 -0.0338072 -0.00210962
## eq2 -0.03380724 0.2136821 0.01356296
## eq3 -0.00210962 0.0135630 0.00211452
##
## The correlations of the residuals
## eq1 eq2 eq3
## eq1 1.000000 -0.989134 -0.620480
## eq2 -0.989134 1.000000 0.638064
## eq3 -0.620480 0.638064 1.000000
##
##
## 3SLS estimates for 'eq1' (equation 1)
## Model Formula: dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06715600 0.13157372 -0.51041 0.61902548
## dPE 0.15308848 0.03614169 4.23579 0.00115607 **
## dAHH 0.45487658 0.50200169 0.90613 0.38270336
## INF -0.01306865 0.00793165 -1.64766 0.12533848
## IR -0.00313454 0.00552198 -0.56765 0.58073923
## dLNKURS -1.45715921 0.33088621 -4.40381 0.00085963 ***
## dLNLF -1.47362512 1.94613674 -0.75721 0.46353620
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.073938 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 0.065603 MSE: 0.005467 Root MSE: 0.073938
## Multiple R-Squared: 0.429603 Adjusted R-Squared: 0.144404
##
##
## 3SLS estimates for 'eq2' (equation 2)
## Model Formula: dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.7065334 0.9987472 0.70742 0.49281626
## dLNG 5.5406346 3.1280894 1.77125 0.10188977
## dAHH -3.8401960 3.9461280 -0.97316 0.34968485
## dM2 0.0106790 0.0335750 0.31806 0.75590298
## dLNLF 11.2248179 14.2028422 0.79032 0.44467796
## dLNKURS 9.0644578 1.9986172 4.53536 0.00068332 ***
## INF 0.1028293 0.0455048 2.25975 0.04323061 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.462258 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 2.564186 MSE: 0.213682 Root MSE: 0.462258
## Multiple R-Squared: 0.712531 Adjusted R-Squared: 0.568797
##
##
## 3SLS estimates for 'eq3' (equation 3)
## Model Formula: dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF + INF
## Instruments: ~INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.14073978 0.04824596 2.91713 0.0129089 *
## dLNG 0.82760343 0.34208535 2.41929 0.0323594 *
## dPE 0.05664100 0.02348772 2.41152 0.0328219 *
## lagINF 0.01812902 0.00590769 3.06872 0.0097400 **
## dUNEM -0.09955531 0.03091475 -3.22032 0.0073501 **
## dLNLF 0.75136245 1.18276774 0.63526 0.5371858
## INF 0.00562158 0.00339744 1.65465 0.1238942
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.045984 on 12 degrees of freedom
## Number of observations: 19 Degrees of Freedom: 12
## SSR: 0.025374 MSE: 0.002115 Root MSE: 0.045984
## Multiple R-Squared: 0.517971 Adjusted R-Squared: 0.276956
#Pendugaan 2SLS dan DWH Simultanitas test
library(AER)
a=ivreg(dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF|INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF, data=data)
b=ivreg(dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF|INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF, data=data)
c=ivreg(dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF + INF|INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF, data=data)
summary(a,diagnostics=TRUE)##
## Call:
## ivreg(formula = dLNG ~ dPE + dAHH + INF + IR + dLNKURS + dLNLF |
## INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.112591 -0.025327 -0.004994 0.013418 0.133839
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.008443 0.163615 0.052 0.9597
## dPE 0.117435 0.060459 1.942 0.0759 .
## dAHH 0.180417 0.624053 0.289 0.7774
## INF -0.003588 0.014582 -0.246 0.8098
## IR -0.010409 0.010463 -0.995 0.3395
## dLNKURS -1.215746 0.473521 -2.567 0.0247 *
## dLNLF -0.688878 2.237773 -0.308 0.7635
##
## Diagnostic tests:
## df1 df2 statistic p-value
## Weak instruments (dPE) 3 11 11.547 0.00101 **
## Weak instruments (dAHH) 3 11 3.679 0.04688 *
## Wu-Hausman 2 10 2.933 0.09946 .
## Sargan 1 NA 1.908 0.16718
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06629 on 12 degrees of freedom
## Multiple R-Squared: 0.5415, Adjusted R-squared: 0.3123
## Wald test: 3.01 on 6 and 12 DF, p-value: 0.0493
summary(b,diagnostics=TRUE)##
## Call:
## ivreg(formula = dPE ~ dLNG + dAHH + dM2 + dLNLF + dLNKURS + INF |
## INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.81612 -0.21131 0.01341 0.20779 0.99467
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.22401 1.19408 0.188 0.85433
## dLNG 7.01697 3.85497 1.820 0.09374 .
## dAHH -2.08507 4.66770 -0.447 0.66305
## dM2 -0.03643 0.07002 -0.520 0.61232
## dLNLF 9.95646 14.47458 0.688 0.50462
## dLNKURS 9.92969 2.31289 4.293 0.00104 **
## INF 0.10036 0.04590 2.186 0.04933 *
##
## Diagnostic tests:
## df1 df2 statistic p-value
## Weak instruments (dLNG) 3 11 3.345 0.0595 .
## Weak instruments (dAHH) 3 11 3.506 0.0530 .
## Wu-Hausman 2 10 6.573 0.0151 *
## Sargan 1 NA 1.755 0.1853
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4939 on 12 degrees of freedom
## Multiple R-Squared: 0.6719, Adjusted R-squared: 0.5078
## Wald test: 5.452 on 6 and 12 DF, p-value: 0.006214
summary(c, vcov = sandwich, diagnostics = TRUE)##
## Call:
## ivreg(formula = dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF +
## INF | INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.060764 -0.031197 0.004543 0.030326 0.056333
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.138592 0.039443 3.514 0.004273 **
## dLNG 0.788294 0.207869 3.792 0.002566 **
## dPE 0.054498 0.011287 4.828 0.000413 ***
## lagINF 0.018597 0.004547 4.090 0.001500 **
## dUNEM -0.087968 0.020394 -4.313 0.001008 **
## dLNLF 0.878745 1.002561 0.877 0.397965
## INF 0.005239 0.002327 2.252 0.043872 *
##
## Diagnostic tests:
## df1 df2 statistic p-value
## Weak instruments (dLNG) 3 11 28.171 1.84e-05 ***
## Weak instruments (dPE) 3 11 69.388 1.97e-07 ***
## Wu-Hausman 2 10 2.526 0.129
## Sargan 1 NA 0.007 0.931
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04434 on 12 degrees of freedom
## Multiple R-Squared: 0.5519, Adjusted R-squared: 0.3278
## Wald test: 7.798 on 6 and 12 DF, p-value: 0.00138
summary(c,diagnostics = TRUE)##
## Call:
## ivreg(formula = dAHH ~ dLNG + dPE + lagINF + dUNEM + dLNLF +
## INF | INF + IR + dLNKURS + dLNLF + dUNEM + dM2 + lagINF,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.060764 -0.031197 0.004543 0.030326 0.056333
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.138592 0.048284 2.870 0.01408 *
## dLNG 0.788294 0.345828 2.279 0.04172 *
## dPE 0.054498 0.023555 2.314 0.03922 *
## lagINF 0.018597 0.005987 3.106 0.00908 **
## dUNEM -0.087968 0.032348 -2.719 0.01863 *
## dLNLF 0.878745 1.186624 0.741 0.47321
## INF 0.005239 0.003442 1.522 0.15386
##
## Diagnostic tests:
## df1 df2 statistic p-value
## Weak instruments (dLNG) 3 11 3.159 0.0682 .
## Weak instruments (dPE) 3 11 30.817 1.19e-05 ***
## Wu-Hausman 2 10 0.784 0.4828
## Sargan 1 NA 0.007 0.9310
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04434 on 12 degrees of freedom
## Multiple R-Squared: 0.5519, Adjusted R-squared: 0.3278
## Wald test: 2.788 on 6 and 12 DF, p-value: 0.06172
Uji Perbandingan Konsistensi 2SLS dan 3SLS
Uji = hausman.systemfit(ive2_sem,ive3_sem)
Uji##
## Hausman specification test for consistency of the 3SLS estimation
##
## data: data
## Hausman = 2.2861, df = 21, p-value = 1
Uji$qVar## eq1_(Intercept) eq1_dPE eq1_dAHH eq1_INF
## eq1_(Intercept) 9.458196e-03 -4.695149e-03 -0.0359416808 1.189979e-03
## eq1_dPE -4.695149e-03 2.349029e-03 0.0179670036 -5.910211e-04
## eq1_dAHH -3.594168e-02 1.796700e-02 0.1374362617 -4.524058e-03
## eq1_INF 1.189979e-03 -5.910211e-04 -0.0045240579 1.497216e-04
## eq1_IR -8.597216e-04 4.228437e-04 0.0032401114 -1.081004e-04
## eq1_dLNKURS 3.265420e-02 -1.640116e-02 -0.1253955728 4.111539e-03
## eq1_dLNLF 1.064270e-01 -5.347509e-02 -0.4088290921 1.340071e-02
## eq2_(Intercept) 1.018178e-01 -5.660271e-03 -0.3775823207 1.141456e-03
## eq2_dLNG 3.707192e-02 7.778871e-02 0.2928711184 -1.191403e-03
## eq2_dAHH -3.343964e-01 4.048538e-02 1.6110907567 -1.117167e-02
## eq2_dM2 -4.964906e-04 -4.634552e-04 -0.0012835308 -1.866106e-05
## eq2_dLNLF -6.454208e-02 -1.792986e-01 -2.5819727099 4.450211e-02
## eq2_dLNKURS 7.129689e-02 3.074617e-02 -0.1165064460 2.809077e-03
## eq2_INF 1.195547e-03 -2.754667e-04 -0.0122853490 2.501573e-04
## eq3_(Intercept) 2.945135e-03 1.022441e-04 -0.0075309879 -1.577946e-05
## eq3_dLNG -1.454777e-02 3.399676e-03 0.0767357856 -6.279713e-04
## eq3_dPE -5.774182e-04 1.974804e-04 0.0033534861 -1.671148e-05
## eq3_lagINF -3.265248e-04 2.630648e-05 0.0014497734 -1.130227e-05
## eq3_dUNEM 1.372737e-03 -1.289593e-04 -0.0063853958 4.064865e-05
## eq3_dLNLF -2.132937e-02 -7.826039e-03 -0.0491074841 1.630130e-03
## eq3_INF -5.342045e-05 -1.553972e-05 -0.0001530601 9.035726e-06
## eq1_IR eq1_dLNKURS eq1_dLNLF eq2_(Intercept)
## eq1_(Intercept) -8.597216e-04 3.265420e-02 0.106426973 0.1018178197
## eq1_dPE 4.228437e-04 -1.640116e-02 -0.053475086 -0.0056602708
## eq1_dAHH 3.240111e-03 -1.253956e-01 -0.408829092 -0.3775823207
## eq1_INF -1.081004e-04 4.111539e-03 0.013400714 0.0011414564
## eq1_IR 7.899030e-05 -2.927095e-03 -0.009535684 0.0012396250
## eq1_dLNKURS -2.927095e-03 1.147362e-01 0.374160925 0.0961853738
## eq1_dLNLF -9.535684e-03 3.741609e-01 1.220180890 0.1794691848
## eq2_(Intercept) 1.239625e-03 9.618537e-02 0.179469185 0.4283329425
## eq2_dLNG -1.219635e-02 -5.711876e-01 -2.299843568 -1.4623023560
## eq2_dAHH -7.273985e-03 -5.261642e-01 -3.095464348 -1.6292345263
## eq2_dM2 1.086381e-04 3.403740e-03 0.014373557 0.0401578655
## eq2_dLNLF 2.610749e-02 1.572648e+00 24.705188703 1.6874631843
## eq2_dLNKURS -5.085286e-03 5.750198e-02 -0.657827877 -0.7617878411
## eq2_INF 4.059330e-05 5.113128e-03 0.048416504 0.0035628539
## eq3_(Intercept) -1.569633e-05 2.968406e-04 -0.016163682 -0.0211571472
## eq3_dLNG -4.214653e-04 -3.824773e-02 -0.177864310 0.1424576949
## eq3_dPE -2.634772e-05 -1.768085e-04 -0.009262779 0.0065061928
## eq3_lagINF -2.524781e-06 -3.281965e-04 -0.002460247 0.0026596505
## eq3_dUNEM 2.414804e-05 1.156443e-03 0.011604052 -0.0124721380
## eq3_dLNLF 1.051914e-03 4.454235e-02 1.122652486 0.0804263056
## eq3_INF 1.563350e-06 9.214276e-05 0.001892016 0.0002961082
## eq2_dLNG eq2_dAHH eq2_dM2 eq2_dLNLF
## eq1_(Intercept) 0.037071924 -0.334396398 -4.964906e-04 -0.06454208
## eq1_dPE 0.077788711 0.040485379 -4.634552e-04 -0.17929862
## eq1_dAHH 0.292871118 1.611090757 -1.283531e-03 -2.58197271
## eq1_INF -0.001191403 -0.011171674 -1.866106e-05 0.04450211
## eq1_IR -0.012196352 -0.007273985 1.086381e-04 0.02610749
## eq1_dLNKURS -0.571187637 -0.526164186 3.403740e-03 1.57264765
## eq1_dLNLF -2.299843568 -3.095464348 1.437356e-02 24.70518870
## eq2_(Intercept) -1.462302356 -1.629234526 4.015787e-02 1.68746318
## eq2_dLNG 5.075841108 5.601355099 -1.361819e-01 -6.07033001
## eq2_dAHH 5.601355099 6.215480071 -1.523178e-01 -6.56376253
## eq2_dM2 -0.136181852 -0.152317776 3.774958e-03 0.15482203
## eq2_dLNLF -6.070330005 -6.563762530 1.548220e-01 7.79285077
## eq2_dLNKURS 2.597239799 2.895962426 -7.145836e-02 -2.98835292
## eq2_INF -0.012921067 -0.013907494 3.257446e-04 0.01683975
## eq3_(Intercept) -0.011228957 0.054214500 8.496032e-05 0.12529672
## eq3_dLNG -0.324538949 -0.651339752 2.120849e-03 1.34456470
## eq3_dPE -0.019852484 -0.030348324 1.389386e-04 0.07142182
## eq3_lagINF -0.002221536 -0.011324743 1.319031e-05 0.01821344
## eq3_dUNEM 0.015325078 0.053854175 -1.105667e-04 -0.09312371
## eq3_dLNLF 0.785434567 0.560317090 -5.415944e-03 -8.60297571
## eq3_INF 0.001363695 0.001367373 -8.763080e-06 -0.01418180
## eq2_dLNKURS eq2_INF eq3_(Intercept) eq3_dLNG
## eq1_(Intercept) 0.0712968932 1.195547e-03 2.945135e-03 -1.454777e-02
## eq1_dPE 0.0307461708 -2.754667e-04 1.022441e-04 3.399676e-03
## eq1_dAHH -0.1165064460 -1.228535e-02 -7.530988e-03 7.673579e-02
## eq1_INF 0.0028090772 2.501573e-04 -1.577946e-05 -6.279713e-04
## eq1_IR -0.0050852863 4.059330e-05 -1.569633e-05 -4.214653e-04
## eq1_dLNKURS 0.0575019766 5.113128e-03 2.968406e-04 -3.824773e-02
## eq1_dLNLF -0.6578278772 4.841650e-02 -1.616368e-02 -1.778643e-01
## eq2_(Intercept) -0.7617878411 3.562854e-03 -2.115715e-02 1.424577e-01
## eq2_dLNG 2.5972397990 -1.292107e-02 -1.122896e-02 -3.245389e-01
## eq2_dAHH 2.8959624255 -1.390749e-02 5.421450e-02 -6.513398e-01
## eq2_dM2 -0.0714583573 3.257446e-04 8.496032e-05 2.120849e-03
## eq2_dLNLF -2.9883529242 1.683975e-02 1.252967e-01 1.344565e+00
## eq2_dLNKURS 1.3549784986 -6.305195e-03 -1.258716e-02 -2.807511e-02
## eq2_INF -0.0063051949 3.650052e-05 1.450429e-04 4.926140e-03
## eq3_(Intercept) -0.0125871628 1.450429e-04 3.677895e-06 -7.333284e-06
## eq3_dLNG -0.0280751091 4.926140e-03 -7.333284e-06 2.574941e-03
## eq3_dPE -0.0177279787 1.480923e-04 1.207008e-06 8.207772e-05
## eq3_lagINF 0.0001600303 8.246812e-05 -1.571765e-06 2.955657e-05
## eq3_dUNEM 0.0046606393 -3.689745e-04 -1.812819e-05 -2.259879e-05
## eq3_dLNLF 0.4148362121 -1.330449e-02 -9.988440e-05 -3.856202e-03
## eq3_INF 0.0007077983 -6.726774e-05 9.714841e-07 -1.278674e-05
## eq3_dPE eq3_lagINF eq3_dUNEM eq3_dLNLF
## eq1_(Intercept) -5.774182e-04 -3.265248e-04 1.372737e-03 -2.132937e-02
## eq1_dPE 1.974804e-04 2.630648e-05 -1.289593e-04 -7.826039e-03
## eq1_dAHH 3.353486e-03 1.449773e-03 -6.385396e-03 -4.910748e-02
## eq1_INF -1.671148e-05 -1.130227e-05 4.064865e-05 1.630130e-03
## eq1_IR -2.634772e-05 -2.524781e-06 2.414804e-05 1.051914e-03
## eq1_dLNKURS -1.768085e-04 -3.281965e-04 1.156443e-03 4.454235e-02
## eq1_dLNLF -9.262779e-03 -2.460247e-03 1.160405e-02 1.122652e+00
## eq2_(Intercept) 6.506193e-03 2.659650e-03 -1.247214e-02 8.042631e-02
## eq2_dLNG -1.985248e-02 -2.221536e-03 1.532508e-02 7.854346e-01
## eq2_dAHH -3.034832e-02 -1.132474e-02 5.385418e-02 5.603171e-01
## eq2_dM2 1.389386e-04 1.319031e-05 -1.105667e-04 -5.415944e-03
## eq2_dLNLF 7.142182e-02 1.821344e-02 -9.312371e-02 -8.602976e+00
## eq2_dLNKURS -1.772798e-02 1.600303e-04 4.660639e-03 4.148362e-01
## eq2_INF 1.480923e-04 8.246812e-05 -3.689745e-04 -1.330449e-02
## eq3_(Intercept) 1.207008e-06 -1.571765e-06 -1.812819e-05 -9.988440e-05
## eq3_dLNG 8.207772e-05 2.955657e-05 -2.259879e-05 -3.856202e-03
## eq3_dPE 3.183895e-06 3.560634e-07 -7.887713e-06 -1.665971e-04
## eq3_lagINF 3.560634e-07 9.443841e-07 7.140920e-06 8.344767e-07
## eq3_dUNEM -7.887713e-06 7.140920e-06 9.070097e-05 5.853728e-04
## eq3_dLNLF -1.665971e-04 8.344767e-07 5.853728e-04 9.136061e-03
## eq3_INF -3.919372e-08 -5.271378e-07 -4.539468e-06 -9.198434e-06
## eq3_INF
## eq1_(Intercept) -5.342045e-05
## eq1_dPE -1.553972e-05
## eq1_dAHH -1.530601e-04
## eq1_INF 9.035726e-06
## eq1_IR 1.563350e-06
## eq1_dLNKURS 9.214276e-05
## eq1_dLNLF 1.892016e-03
## eq2_(Intercept) 2.961082e-04
## eq2_dLNG 1.363695e-03
## eq2_dAHH 1.367373e-03
## eq2_dM2 -8.763080e-06
## eq2_dLNLF -1.418180e-02
## eq2_dLNKURS 7.077983e-04
## eq2_INF -6.726774e-05
## eq3_(Intercept) 9.714841e-07
## eq3_dLNG -1.278674e-05
## eq3_dPE -3.919372e-08
## eq3_lagINF -5.271378e-07
## eq3_dUNEM -4.539468e-06
## eq3_dLNLF -9.198434e-06
## eq3_INF 3.025864e-07
Uji$statistic## [,1]
## [1,] 2.286074
## attr(,"names")
## [1] "Hausman"
#Perhitungan manual p-value
a=1-pchisq(Uji$statistic,Uji$parameter)
print(a)## [,1]
## [1,] 0.9999999
Asumsi Residual 3SLS
Multivariate Normal
#Multivariate Normal
ty = data.frame(residuals(ive3_sem))
#Uji Henze Zirkler MVN
library(mvnTest)
HZ.test(ty[2:20,],qqplot = TRUE)## Henze-Zirkler test for Multivariate Normality
##
## data : ty[2:20, ]
##
## HZ : 0.8254725
## p-value : 0.04898418
##
## Result : Data are not multivariate normal (sig.level = 0.05)
#Uji Mshapiro Wilk
library(mvnormtest)
mshapiro.test(t(ty[2:20,]))##
## Shapiro-Wilk normality test
##
## data: Z
## W = 0.76475, p-value = 0.0003672
library(nortest)
lillie.test(ty$eq3)##
## Lilliefors (Kolmogorov-Smirnov) normality test
##
## data: ty$eq3
## D = 0.11335, p-value = 0.7507
ks.test(ty$eq3,"pnorm")##
## Exact one-sample Kolmogorov-Smirnov test
##
## data: ty$eq3
## D = 0.47767, p-value = 0.0001659
## alternative hypothesis: two-sided
shapiro.test(ty$eq3)##
## Shapiro-Wilk normality test
##
## data: ty$eq3
## W = 0.95555, p-value = 0.4883
library(caret)
library(MASS)
library(klaR)
library(MVN)
library(biotools)
library(candisc)
library(DFA.CANCOR)
nm.mardia.test <- mvn(ty[2:20,], mvnTest = "mardia",
multivariateOutlierMethod = "adj",showNewData = F)##Deteksi Multikolinearitas
#Panel of correlations
panel.corr <- function(x, y){
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- round(cor(x, y), digits=3)
txt <- paste0("Corr: ", r)
text(0.5, 0.5, txt, cex = 1)
}
#Panel of histograms
panel.hist <- function(x, ...){
usr <- par("usr"); on.exit(par(usr))
par(usr = c(usr[1:2], 0, 1.5) )
h <- hist(x, plot = FALSE)
breaks <- h$breaks
len <- length(breaks)
y <- h$counts/max(h$counts)
rect(breaks[-len], 0, breaks[-1], y, col = "lightblue")
}
#Panel of scatterplots
panel.scat <- function(x, y){
points(x,y, pch = 19, cex = 1, col = rainbow(2))
lines(stats::lowess(x,y))
}
#Plot
pairs(awal[, c(2:10)],
lower.panel = panel.scat,
upper.panel = panel.corr,
diag.panel = panel.hist,
labels = c("G","Pe","AHH",
"INF","Kurs","IR","LF","M2","Unem"),
gap = 0.5,
main = "Scatterplot Variabel Penelitian")##Variabel Transformasi
## Menggunakan chart.Correlation()
library(PerformanceAnalytics)
chart.Correlation(data[,c(2:11)],
histogram = TRUE, # tambahkan histogram pada diagonal
pch = 1,method = "pearson") # jenis point = 1Contoh Demand and Supply Theory
data( "Kmenta" )
eqDemand <- consump ~ price + income
eqSupply <- consump ~ price + farmPrice + trend
inst <- ~ income + farmPrice + trend
system <- list( demand = eqDemand, supply = eqSupply )
## perform the estimations
fit2sls <- systemfit( system, "2SLS", inst = inst, data = Kmenta )
fit3sls <- systemfit( system, "3SLS", inst = inst, data = Kmenta )
## perform the Hausman test
h <- hausman.systemfit( fit2sls, fit3sls )
print( h )##
## Hausman specification test for consistency of the 3SLS estimation
##
## data: Kmenta
## Hausman = 2.5357, df = 7, p-value = 0.9244
summary(fit2sls)##
## systemfit results
## method: 2SLS
##
## N DF SSR detRCov OLS-R2 McElroy-R2
## system 40 33 162.362 4.36424 0.697214 0.548127
##
## N DF SSR MSE RMSE R2 Adj R2
## demand 20 17 65.7291 3.86642 1.96632 0.754847 0.726005
## supply 20 16 96.6332 6.03958 2.45756 0.639582 0.572004
##
## The covariance matrix of the residuals
## demand supply
## demand 3.86642 4.35744
## supply 4.35744 6.03958
##
## The correlations of the residuals
## demand supply
## demand 1.000000 0.901724
## supply 0.901724 1.000000
##
##
## 2SLS estimates for 'demand' (equation 1)
## Model Formula: consump ~ price + income
## Instruments: ~income + farmPrice + trend
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 94.6333039 7.9208383 11.94738 1.0762e-09 ***
## price -0.2435565 0.0964843 -2.52431 0.021832 *
## income 0.3139918 0.0469437 6.68869 3.8109e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.966321 on 17 degrees of freedom
## Number of observations: 20 Degrees of Freedom: 17
## SSR: 65.729088 MSE: 3.866417 Root MSE: 1.966321
## Multiple R-Squared: 0.754847 Adjusted R-Squared: 0.726005
##
##
## 2SLS estimates for 'supply' (equation 2)
## Model Formula: consump ~ price + farmPrice + trend
## Instruments: ~income + farmPrice + trend
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 49.5324417 12.0105264 4.12409 0.00079536 ***
## price 0.2400758 0.0999339 2.40235 0.02878451 *
## farmPrice 0.2556057 0.0472501 5.40964 5.7854e-05 ***
## trend 0.2529242 0.0996551 2.53800 0.02192877 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.457555 on 16 degrees of freedom
## Number of observations: 20 Degrees of Freedom: 16
## SSR: 96.633244 MSE: 6.039578 Root MSE: 2.457555
## Multiple R-Squared: 0.639582 Adjusted R-Squared: 0.572004
summary(fit3sls)##
## systemfit results
## method: 3SLS
##
## N DF SSR detRCov OLS-R2 McElroy-R2
## system 40 33 173.643 1.0332 0.676177 0.786468
##
## N DF SSR MSE RMSE R2 Adj R2
## demand 20 17 65.7291 3.86642 1.96632 0.754847 0.726005
## supply 20 16 107.9138 6.74461 2.59704 0.597508 0.522041
##
## The covariance matrix of the residuals used for estimation
## demand supply
## demand 3.86642 4.35744
## supply 4.35744 6.03958
##
## The covariance matrix of the residuals
## demand supply
## demand 3.86642 5.00443
## supply 5.00443 6.74461
##
## The correlations of the residuals
## demand supply
## demand 1.00000 0.97999
## supply 0.97999 1.00000
##
##
## 3SLS estimates for 'demand' (equation 1)
## Model Formula: consump ~ price + income
## Instruments: ~income + farmPrice + trend
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 94.6333039 7.9208383 11.94738 1.0762e-09 ***
## price -0.2435565 0.0964843 -2.52431 0.021832 *
## income 0.3139918 0.0469437 6.68869 3.8109e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.966321 on 17 degrees of freedom
## Number of observations: 20 Degrees of Freedom: 17
## SSR: 65.729088 MSE: 3.866417 Root MSE: 1.966321
## Multiple R-Squared: 0.754847 Adjusted R-Squared: 0.726005
##
##
## 3SLS estimates for 'supply' (equation 2)
## Model Formula: consump ~ price + farmPrice + trend
## Instruments: ~income + farmPrice + trend
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 52.1972042 11.8933720 4.38876 0.00045780 ***
## price 0.2285892 0.0996732 2.29339 0.03570648 *
## farmPrice 0.2281580 0.0439938 5.18614 9.0087e-05 ***
## trend 0.3611384 0.0728894 4.95461 0.00014343 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.597039 on 16 degrees of freedom
## Number of observations: 20 Degrees of Freedom: 16
## SSR: 107.913821 MSE: 6.744614 Root MSE: 2.597039
## Multiple R-Squared: 0.597508 Adjusted R-Squared: 0.522041