Paket Analysis
##install.packages("ioanalysis")
library(ioanalysis)
## Loading required package: ggplot2
## Loading required package: plot3D
## Loading required package: lpSolve
library(ggplot2)
library(plot3D)
library(lpSolve)
b001<-c(72,13,8,58,60,22,24,91,43,92)
b002<-c(5,1,28,64,94,65,96,15,76,30)
b003<-c(53,7,47,25,93,16,90,79,81,23)
b004<-c(46,41,66,96,90,49,2,29,35,66)
b005<-c(73,40,37,87,29,47,95,97,46,1)
b006<-c(55,67,26,95,10,16,96,67,70,99)
b007<-c(73,24,19,9,65,52,82,79,77,87)
b008<-c(96,63,46,97,68,36,47,40,76,61)
b009<-c(28,32,44,86,22,68,45,89,6,48)
b010<-c(81,62,91,64,52,100,58,94,65,17)
Z <-matrix(rbind(b001,b002,b003,b004,b005,b006,b007,b008,b009,b010), ncol=10)
region <- c(rep("Sulawesi Selatan",5),rep("Jawa Timur",5))
sector <- c("Pertanian","Perikanan","Industri","Pemerintahan","Jasa")
sector <- c(sector,sector)
id <- rbind(region,sector)
blank <- matrix(NA, ncol = 2, nrow = 2)
Z <- rbind( cbind(blank, id), cbind(t(id), Z))
V<-matrix(c(
297,284,126,196,179,211,132,147,141,259,
247,106,107,103,280,293,183,264,272,221,
173,266,100,199,191,119,251,238,286,227), ncol=10, byrow=TRUE)
label <- matrix(c("Upah", "Pendapatan Pemilik", "Pajak Tak Langsung"),
ncol = 1)
blank <- matrix(NA, ncol = 1, nrow = 3)
V <- cbind(blank, label, V)
f<-matrix(c(
177,296,236,169,285,52,208,64,
199,167,23,63,105,59,87,166,
270,35,51,97,218,223,155,106,
71,117,202,255,4,261,200,156,
153,18,24,108,91,123,60,267,
37,22,48,102,12,286,196,179,
241,147,165,26,150,209,269,228,
154,142,141,84,139,29,290,164,
299,211,289,219,284,78,203,122,
297,291,14,185,215,229,89,6),nrow =10,byrow=TRUE)
label <- c("Rumahtangga", "Pemerintah", "Investasi", "Ekspor")
label <- matrix(c(label, label), nrow = 1)
id <- rbind(region[c(1:4,6:9)], label)
f <- rbind(id, f)
one.10 <- matrix(rep(1, 10), ncol = 1)
one.8 <- matrix(rep(1, 8), ncol = 1)
X <- matrix(as.numeric(Z[3:12, 3:12]), nrow = 10)%*%one.10 +
matrix(as.numeric(f[3:12,]), nrow = 10)%*%one.8
label <- matrix(c(NA,"Total"))
X <- rbind(label, X)
M <- matrix(NA, nrow = 1, ncol = 12)
one.3 <- matrix(rep(1, 3), ncol = 1)
M[1, 3:12] <- t(one.10)%*%matrix(as.numeric(Z[3:12, 3:12]), nrow = 10) +
t(one.3)%*%matrix(as.numeric(V[,3:12]), nrow = 3)
M[1, 2] <- "Impor"
blank <- matrix(NA, nrow=5, ncol = 9)
holder <- cbind(f, X)
holder <- rbind(holder, blank)
hold <- rbind(Z, V, M, t(X))
ss.FullIOTable <- cbind(hold, holder)
fV <- matrix(c(
21,22,55,27,33,77,
78,77,53,20,1,48), ncol=6, byrow=TRUE)
ss.FullIOTable[15:16, c(13:15, 17:19)] <- fV
Z <- matrix(as.numeric(ss.FullIOTable[3:12, 3:12]), ncol = 10)
f <- matrix(as.numeric(ss.FullIOTable[3:12, c(13:15, 17:19)]), nrow = dim(Z)[1])
E <- matrix(as.numeric(ss.FullIOTable[3:12, c(16, 20)]), nrow = 10)
X <- matrix(as.numeric(ss.FullIOTable[3:12, 21]), ncol = 1)
V <- matrix(as.numeric(ss.FullIOTable[13:15, 3:12]), ncol = 10)
M <- as.numeric(ss.FullIOTable[16, 3:12])
fV <- matrix(as.numeric(ss.FullIOTable[15:16, c(13:15,17:19)]), nrow = 2)
ss.IO <- as.inputoutput(Z = Z, RS_label = ss.FullIOTable[3:12, 1:2],
f = f, f_label = ss.FullIOTable[1:2, c(13:15, 17:19)],
E = E, E_label = ss.FullIOTable[1:2, c(16, 20)],
X = X,
V = V, V_label = ss.FullIOTable[13:15, 2],
M = M, M_label = ss.FullIOTable[16,2],
fV = fV, fV_label = ss.FullIOTable[15:16, 2])
check.RS(ss.IO)
## [1] TRUE
linkages(ss.IO, ES = NULL, regions = "all", sectors = "all", type = c("total"),
normalize = FALSE, intra.inter = FALSE)
## $`Sulawesi Selatan`
## BL.tot FL.tot
## Pertanian 1.435956 1.359417
## Perikanan 1.386453 1.517649
## Industri 1.360057 1.447335
## Pemerintahan 1.563565 1.430537
## Jasa 1.607494 1.574279
##
## $`Jawa Timur`
## BL.tot FL.tot
## Pertanian 1.460790 1.586101
## Perikanan 1.460265 1.413869
## Industri 1.557731 1.515752
## Pemerintahan 1.385242 1.319484
## Jasa 1.381315 1.499344
export.total(ss.IO)
## [,1]
## [1,] 1050
## [2,] 762
## [3,] 1088
## [4,] 1057
## [5,] 935
## [6,] 641
## [7,] 997
## [8,] 1055
## [9,] 1352
## [10,] 1143
import.total(ss.IO)
## [,1]
## [1,] 1299
## [2,] 1006
## [3,] 745
## [4,] 1179
## [5,] 1233
## [6,] 1094
## [7,] 1201
## [8,] 1329
## [9,] 1274
## [10,] 1231
extraction(ss.IO, ES = NULL, regions = 1, sectors = 1, type = "backward.total",
aggregate = FALSE, simultaneous = FALSE, normalize = FALSE)
## Pertanian
## Sulawesi Selatan.Pertanian 668.4299
## Sulawesi Selatan.Perikanan 373.1259
## Sulawesi Selatan.Industri 387.9606
## Sulawesi Selatan.Pemerintahan 600.7683
## Sulawesi Selatan.Jasa 584.2872
## Jawa Timur.Pertanian 480.8720
## Jawa Timur.Perikanan 463.1370
## Jawa Timur.Industri 497.8907
## Jawa Timur.Pemerintahan 495.6907
## Jawa Timur.Jasa 444.4978
RS_label = ss.IO$RS_label
obj = ss.IO$L
heatmap.io(obj, RS_label, FUN = log, max = 3)
cuberoot = function(x){x^(1/3)}
heatmap.io(obj, RS_label, FUN = cuberoot)
# Total field of influence
fit = f.influence.total(ss.IO)
heatmap.io(fit, RS_label, sectors_x = c(1,3,4,5), regions_y = c(2), sectors = 1:3)
obj = ss.IO$Z[1:5, 1:5]
hist3d.io(obj, alpha = 0.7)
export.total(ss.IO)
## [,1]
## [1,] 1050
## [2,] 762
## [3,] 1088
## [4,] 1057
## [5,] 935
## [6,] 641
## [7,] 997
## [8,] 1055
## [9,] 1352
## [10,] 1143
import.total(ss.IO)
## [,1]
## [1,] 1299
## [2,] 1006
## [3,] 745
## [4,] 1179
## [5,] 1233
## [6,] 1094
## [7,] 1201
## [8,] 1329
## [9,] 1274
## [10,] 1231
—————————————————————–Thanks————————————