1. Đọc dữ liệu
setwd("c:/vidu")
library(readxl)
dulieu <- read_excel("tfpEX.xlsx")
dulieu <-data.frame(dulieu)
head(dulieu)
## GDP X1 X2 X3 K L LnGDP LnL
## 1 95.74777 38.91503 42.57564 42.66912 67.33140 74.47892 18.24687 4.209627
## 2 103.47966 51.50233 42.03560 40.97754 77.49099 78.90203 18.55750 4.350162
## 3 103.57082 46.79781 45.13920 37.50353 75.18431 80.19818 18.56102 4.319943
## 4 109.01618 55.40186 40.41414 36.94005 82.20902 81.57537 18.76599 4.409265
## 5 100.32173 56.12545 41.77848 45.43074 78.22359 76.90443 18.43353 4.359571
## 6 111.56880 35.52985 39.99713 37.32426 73.54932 82.94013 18.85857 4.297956
## LnK PROVINCE YEAR TINH
## 1 25.86310 A 1981 1
## 2 26.20924 A 1982 1
## 3 26.30700 A 1983 1
## 4 26.40916 A 1984 1
## 5 26.05538 A 1985 1
## 6 26.50871 A 1986 1
Ước lượng TFPC 1 nền kinh tế
library(snfa)
## Warning: package 'snfa' was built under R version 3.6.3
uocluong <- technical.efficiency.change(df=dulieu, input.var.names =c("LnK","LnL"), output.var.name ="LnGDP", firm.var.name ="PROVINCE", time.var.name="YEAR", method = "u")
head(uocluong)
## YEAR PROVINCE technical.change efficiency.change productivity.change
## 2 1982 A 1.0002100 0.9948706 0.9950796
## 42 1982 B 0.9984343 1.0076175 1.0060398
## 82 1982 C 0.9975187 1.0028369 1.0003486
## 122 1982 D 0.9997772 0.9999832 0.9997605
## 162 1982 E 1.0148301 1.0061875 1.0211093
## 3 1983 A 0.9996647 1.0014441 1.0011083
Vẽ đồ thị
library(ggplot2)
ggplot(uocluong, aes(YEAR, technical.change)) +
geom_line(aes(color = PROVINCE))

ggplot(uocluong, aes(YEAR, efficiency.change)) +
geom_line(aes(color = PROVINCE))

ggplot(uocluong, aes(YEAR, productivity.change)) +
geom_line(aes(color = PROVINCE))

Sắp lại lại dữ liệu
library(tidyverse)
## -- Attaching packages ------------------------------------------------------- tidyverse 1.3.0 --
## v tibble 2.1.3 v dplyr 0.8.3
## v tidyr 1.0.0 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## v purrr 0.3.3
## -- Conflicts ---------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
uocluong2 <- uocluong%>%arrange(PROVINCE,YEAR)
head(uocluong2)
## YEAR PROVINCE technical.change efficiency.change productivity.change
## 1 1982 A 1.0002100 0.9948706 0.9950796
## 2 1983 A 0.9996647 1.0014441 1.0011083
## 3 1984 A 1.0030048 1.0022879 1.0052996
## 4 1985 A 0.9868656 1.0021816 0.9890185
## 5 1986 A 1.0037942 1.0000491 1.0038435
## 6 1987 A 1.0047817 0.9911951 0.9959346
Chạy DEA: Malmquist productivity index 1 nền kinh tế
library(productivity)
## Warning: package 'productivity' was built under R version 3.6.3
##
## * Please cite the 'productivity' package as:
## Dakpo K.H., Desjeux Y. and Latruffe L. (2018). productivity: Indices of Productivity and Profitability Using Data Envelopment Analysis (DEA). R package version 1.1.0.
##
## See also: citation("productivity")
##
## * For any questions, suggestions, or comments on the 'productivity' package, please make use of Tracker facilities at:
## https://r-forge.r-project.org/projects/productivity/
#Gói này: Yêu cầu dữ liệu phải cân bằng
Malmquist <- malm(data = dulieu, id.var = "PROVINCE", time.var = "YEAR",
x.vars = c("LnK", "LnL"),
y.vars = "LnGDP", rts = "nirs", tech.reg = TRUE
)
## Warning: package 'doParallel' was built under R version 3.6.3
## Loading required package: foreach
##
## Attaching package: 'foreach'
## The following objects are masked from 'package:purrr':
##
## accumulate, when
## Loading required package: iterators
## Loading required package: parallel
##
Progress: 0%
Progress: 5%
Progress: 10%
Progress: 15%
Progress: 20%
Progress: 25%
Progress: 30%
Progress: 35%
Progress: 40%
Progress: 45%
Progress: 50%
Progress: 55%
Progress: 60%
Progress: 65%
Progress: 70%
Progress: 75%
Progress: 80%
Progress: 85%
Progress: 90%
Progress: 95%
DONE!
##
thaydoi<-Malmquist$Changes
thaydoi <- thaydoi %>%arrange(PROVINCE)
head(thaydoi)
## PROVINCE Year.1 Year.0 malmquist effch tech obtech ibtech
## 1 A 1982 1981 0.9953239 0.9921205 1.0032289 1 0.9988043
## 2 A 1983 1982 0.9988703 1.0017513 0.9971241 1 1.0001371
## 3 A 1984 1983 1.0012036 0.9996732 1.0015308 1 1.0032689
## 4 A 1985 1984 0.9950273 1.0006173 0.9944135 1 0.9994030
## 5 A 1986 1985 1.0084542 1.0058879 1.0025513 1 1.0028761
## 6 A 1987 1986 0.9860531 0.9911949 0.9948125 1 1.0125870
## matech pure.out.effch out.scalech
## 1 1.0044298 0.9921205 1.0000000
## 2 0.9969874 1.0036399 0.9981183
## 3 0.9982676 0.9991754 1.0004982
## 4 0.9950075 1.0023429 0.9982784
## 5 0.9996762 1.0027660 1.0031133
## 6 0.9824464 0.9911949 1.0000000
Chạy Malmquist 2 nền kinh tế
library(Benchmarking)
## Loading required package: ucminf
# Gói này: Không yêu cầu dữ liệu cân bằng
X0 <- dulieu %>% select("X2","X3") %>% as.matrix(ncol=2)
Y0 <- dulieu %>% select("X1") %>% as.matrix(ncol=1)
X1 <- dulieu %>% select("LnK","LnL") %>% as.matrix(ncol=2)
Y1 <- dulieu %>% select("LnGDP") %>% as.matrix(ncol=1)
X2 <- dulieu %>% select("LnK","LnL")
Y2 <- dulieu %>% select("LnGDP")
m <- malmq(X0,Y0,,X1,Y1,,RTS="vrs")
m
## $m
## [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
##
## $tc
## [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
##
## $ec
## [1] 1.3697047 1.3262187 1.3115497 1.2155856 1.3432441 1.2422963 1.1268364
## [8] 1.2759560 1.2098399 1.0712056 1.2869154 1.3326197 1.3407653 1.4402943
## [15] 0.9853764 1.4266867 1.4894013 1.2081883 1.2227274 1.2760669 1.1214146
## [22] 1.1995192 1.3667751 1.4341488 1.1984783 1.2148992 1.3527377 1.3317152
## [29] 1.1845702 1.3482562 1.1894090 1.2454826 1.3838202 1.3032224 1.2707326
## [36] 1.2053320 1.0396891 1.1932674 1.2296715 1.1133550 1.2347381 1.1928297
## [43] 1.3601735 1.4360601 1.4296193 1.2536003 1.2114614 1.2331384 1.1048671
## [50] 1.3306439 1.2600220 1.1037224 1.1533378 1.2658793 0.9730669 1.2032641
## [57] 1.2866895 1.2855571 0.9905950 1.2814460 1.0490001 1.2329380 0.9845319
## [64] 1.0215952 1.0915788 1.1219061 1.3263165 1.3052347 1.1401610 1.2161807
## [71] 1.2139640 1.2976028 1.3153181 1.4241330 1.4427284 1.2025539 1.1533582
## [78] 1.1928793 1.1898650 1.2167433 1.3294748 1.3239574 1.4251058 1.1643940
## [85] 1.2988210 1.2344102 1.0764539 1.2354543 1.3291025 1.3833826 1.2666170
## [92] 1.2515904 1.4233443 1.1521716 1.3713002 1.2641703 1.3565208 1.1552108
## [99] 1.2524309 1.3217981 1.2110217 0.9816064 1.1531588 1.0081206 1.1724087
## [106] 1.1826880 1.2506507 1.1852691 1.1783496 1.3285584 1.1043342 1.2914388
## [113] 1.3555556 1.2427133 1.2170103 1.4415351 1.1560302 1.1094575 1.2825427
## [120] 1.2504366 1.2026973 1.2025872 1.1217206 1.4712063 1.2252784 1.3671649
## [127] 1.3210105 1.0654359 1.2943732 1.0708287 1.1195647 1.3005846 1.1834854
## [134] 1.2676015 0.9989684 1.2273570 1.3489089 1.3414113 1.1815065 1.3749877
## [141] 1.4196309 1.0307510 1.1836552 1.4445316 1.1476743 1.2862644 1.2196259
## [148] 1.2055924 1.0101596 1.0083683 1.2270887 1.1409750 1.2960182 1.2294587
## [155] 1.5403263 1.2065578 1.3688987 1.2285966 1.2345297 1.1351167 1.3387692
## [162] 1.1953708 1.5206528 1.1875484 1.1561409 1.3980339 1.2610282 1.3923992
## [169] 0.9883691 1.3022959 1.0000000 1.2606687 1.4372676 1.1966378 1.5063459
## [176] 1.2270598 1.2357936 1.4476683 1.1065893 1.3001193 1.2603501 1.1019266
## [183] 1.1489428 1.1077697 1.1878442 1.0294540 0.9958448 1.0652603 1.3063333
## [190] 1.2516781 1.4812507 1.2277433 1.0033415 1.3399162 0.9877492 1.1869372
## [197] 0.9900575 1.3244180 1.2605970 1.2794743
##
## $mq
## [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
##
## $id
## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
## [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
## [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
## [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
## [91] 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
## [109] 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
## [127] 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
## [145] 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
## [163] 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
## [181] 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
## [199] 199 200
##
## $id0
## [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [121] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [136] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [151] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [166] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [181] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [196] TRUE TRUE TRUE TRUE TRUE
##
## $id1
## [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [121] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [136] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [151] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [166] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [181] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [196] TRUE TRUE TRUE TRUE TRUE
##
## $e00
## [1] 0.7184388 0.7384722 0.7459699 0.8091932 0.7280581 0.7940537 0.8687789
## [8] 0.7733253 0.8047168 0.9221132 0.7625643 0.7352970 0.7303544 0.6799427
## [15] 1.0000000 0.6811174 0.6499245 0.8137551 0.8178438 0.7645130 0.8769311
## [22] 0.8220413 0.7147476 0.6811047 0.8330628 0.8130031 0.7255649 0.7351587
## [29] 0.8323084 0.7265270 0.8292779 0.7919569 0.7192885 0.7589639 0.7785134
## [36] 0.8118716 0.9618260 0.8224906 0.8064318 0.8968348 0.7970718 0.8277068
## [43] 0.7258567 0.6811485 0.6878242 0.7795512 0.8046051 0.8015858 0.8933139
## [50] 0.7408919 0.7817743 0.9008781 0.8590979 0.7777312 1.0000000 0.8103788
## [57] 0.7771883 0.7635302 1.0000000 0.7629409 0.9390758 0.7987500 0.9982938
## [64] 0.9750778 0.9106702 0.8764173 0.7539679 0.7542716 0.8731927 0.8121084
## [71] 0.8053805 0.7595290 0.7453204 0.6896275 0.6746161 0.8249489 0.8479194
## [78] 0.8326361 0.8283911 0.8041145 0.7390422 0.7424752 0.6909985 0.8514662
## [85] 0.7587388 0.7946619 0.9197201 0.7993326 0.7501013 0.7091867 0.7824340
## [92] 0.7822023 0.6985357 0.8547424 0.7161350 0.7714920 0.7258625 0.8544428
## [99] 0.7843777 0.7438785 0.8215370 1.0000000 0.8552517 0.9910607 0.8360469
## [106] 0.8345330 0.7851788 0.8424105 0.8297610 0.7404492 0.8849383 0.7667880
## [113] 0.7266644 0.7995084 0.8115544 0.6909833 0.8469273 0.8934521 0.7692496
## [120] 0.7763260 0.8254599 0.8250170 0.8807565 0.6797143 0.8070850 0.7166938
## [127] 0.7415202 0.9077580 0.7563880 0.9245875 0.8840319 0.7518603 0.8358400
## [134] 0.7888915 0.9944155 0.7990994 0.7292896 0.7388111 0.8393752 0.7105234
## [141] 0.6939083 0.9554734 0.8323038 0.6699511 0.8457001 0.7708882 0.8100482
## [148] 0.8179664 0.9899426 0.9675106 0.7968953 0.8667884 0.7543605 0.8044870
## [155] 0.6313027 0.8169883 0.7168826 0.7961161 0.7990761 0.8723544 0.7341735
## [162] 0.8296638 0.6449044 0.8364868 0.8503103 0.7009377 0.7855258 0.7097960
## [169] 1.0000000 0.7555864 1.0000000 0.7822545 0.6819910 0.8333810 0.6514569
## [176] 0.8091129 0.7912061 0.6729460 0.8872630 0.7672732 0.7788288 0.8916079
## [183] 0.8670579 0.8998703 0.8351026 0.9683530 1.0000000 0.9387377 0.7556600
## [190] 0.7921824 0.6725654 0.8132334 0.9840762 0.7348215 1.0000000 0.8311835
## [197] 1.0000000 0.7363449 0.7767971 0.7679589
##
## $e10
## [1] 5.317897 5.146099 5.182097 5.077119 5.134992 5.208606 5.091965 5.244499
## [9] 5.115884 5.142259 5.086485 5.201391 5.144284 5.247437 5.190235 5.118082
## [17] 5.241101 5.150125 5.026807 5.118955 5.182565 4.981170 5.266507 5.230255
## [25] 5.300842 5.214829 5.264378 5.208014 5.239709 5.235421 5.246097 5.033368
## [33] 5.092805 5.278865 5.312956 5.198407 5.337858 5.110223 5.159717 5.413766
## [41] 5.144685 5.276655 5.320602 5.181129 5.277090 5.116227 5.086737 5.091609
## [49] 5.157702 5.314614 5.151065 5.259484 5.040506 5.079805 5.112952 5.178543
## [57] 5.456563 5.204952 5.022266 5.266002 5.172506 5.167356 5.090023 5.215463
## [65] 5.471951 5.160531 5.522001 5.205886 5.432484 5.134324 5.153812 5.176237
## [73] 5.227381 5.229276 5.033102 5.400966 5.047974 5.395134 5.122804 5.150521
## [81] 5.127114 5.112302 5.297677 5.229838 5.204791 5.250646 5.158731 5.181607
## [89] 5.132439 5.324941 5.274846 5.048312 5.426536 5.184891 5.191387 5.025353
## [97] 5.167063 5.179879 5.141816 5.217873 5.354318 5.017358 5.195901 5.201229
## [105] 5.101080 5.108736 5.164293 5.421654 5.136713 5.243859 5.108753 5.253438
## [113] 5.027532 4.999282 5.239036 5.496991 5.198424 5.112953 5.112140 5.070716
## [121] 5.079044 5.047166 5.247749 5.539232 5.319548 5.079448 5.242659 5.088104
## [129] 5.187158 5.168055 5.146126 5.076047 5.081554 5.503996 5.174488 5.221914
## [137] 5.221882 5.295919 5.190876 5.325204 5.339191 5.050043 5.299336 5.050554
## [145] 5.036202 5.072936 5.331736 5.086677 4.944937 5.029130 5.162641 5.328616
## [153] 5.220155 5.191792 5.141247 5.168505 5.237351 5.141633 5.023064 5.307089
## [161] 5.425750 5.356088 5.108594 5.074815 5.180704 5.174132 5.126154 5.307432
## [169] 5.150514 5.161148 5.199410 5.205893 5.304700 5.322104 5.300275 5.049342
## [177] 5.192049 5.232371 5.147758 5.452240 5.324657 5.201768 5.256768 5.276647
## [185] 5.323844 5.212862 4.873867 5.285384 5.161804 5.106600 5.290408 5.322712
## [193] 5.283296 5.293130 5.360427 5.277340 5.149840 5.164096 5.238292 5.150876
##
## $e11
## [1] 0.9840489 0.9793757 0.9783765 0.9836435 0.9779597 0.9864499 0.9789717
## [8] 0.9867291 0.9735785 0.9877728 0.9813557 0.9798713 0.9792339 0.9793175
## [15] 0.9853764 0.9717412 0.9679984 0.9831693 1.0000000 0.9755698 0.9834033
## [22] 0.9860543 0.9768992 0.9768055 0.9984077 0.9877168 0.9814990 0.9790220
## [29] 0.9859277 0.9795446 0.9863506 0.9863686 0.9953659 0.9890988 0.9892823
## [36] 0.9785748 1.0000000 0.9814512 0.9916462 0.9984954 0.9841749 0.9873133
## [43] 0.9872911 0.9781702 0.9833268 0.9772455 0.9747480 0.9884663 0.9869932
## [50] 0.9858633 0.9850528 0.9943194 0.9908300 0.9845139 0.9730669 0.9750997
## [57] 1.0000000 0.9815617 0.9905950 0.9776675 0.9850906 0.9848093 0.9828521
## [64] 0.9961348 0.9940683 0.9832579 1.0000000 0.9845014 0.9955803 0.9876705
## [71] 0.9777030 0.9855669 0.9803334 0.9821213 0.9732878 0.9920455 0.9779548
## [78] 0.9932344 0.9856736 0.9784009 0.9825380 0.9830055 0.9847459 0.9914422
## [85] 0.9854659 0.9809388 0.9900363 0.9875389 0.9969615 0.9810766 0.9910442
## [92] 0.9789970 0.9942568 0.9848099 0.9820360 0.9752973 0.9846475 0.9870615
## [99] 0.9823788 0.9832572 0.9948991 0.9816064 0.9862410 0.9991087 0.9801887
## [106] 0.9869921 0.9819845 0.9984832 0.9777486 0.9837299 0.9772676 0.9902597
## [113] 0.9850340 0.9935597 0.9876701 0.9960766 0.9790735 0.9912471 0.9865954
## [120] 0.9707464 0.9927784 0.9921548 0.9879627 1.0000000 0.9889038 0.9798387
## [127] 0.9795560 0.9671579 0.9790483 0.9900749 0.9897309 0.9778579 0.9892044
## [134] 1.0000000 0.9933896 0.9807802 0.9837452 0.9910495 0.9917273 0.9769609
## [141] 0.9850937 0.9848552 0.9851607 0.9677655 0.9705883 0.9915661 0.9879558
## [148] 0.9861340 1.0000000 0.9756070 0.9778612 0.9889838 0.9776649 0.9890835
## [155] 0.9724122 0.9857436 0.9813397 0.9781055 0.9864831 0.9902240 0.9828889
## [162] 0.9917559 0.9806757 0.9933686 0.9830784 0.9799346 0.9905702 0.9883194
## [169] 0.9883691 0.9839971 1.0000000 0.9861638 0.9802035 0.9972551 0.9813194
## [176] 0.9928299 0.9777674 0.9742027 0.9818357 0.9975467 0.9815970 0.9824865
## [183] 0.9961999 0.9968491 0.9919718 0.9968748 0.9958448 1.0000000 0.9871437
## [190] 0.9915574 0.9962379 0.9984418 0.9873645 0.9845992 0.9877492 0.9865626
## [197] 0.9900575 0.9752285 0.9792281 0.9825836
##
## $e01
## [1] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [19] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [37] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [55] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [73] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [91] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [109] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [127] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [145] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [163] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [181] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
## [199] Inf Inf
# Dữ liệu một chiều
So sánh kết quả TE cua PP SFA
library(frontier)
## Loading required package: micEcon
##
## If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
## https://r-forge.r-project.org/projects/micecon/
## Loading required package: lmtest
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Please cite the 'frontier' package as:
## Tim Coelli and Arne Henningsen (2013). frontier: Stochastic Frontier Analysis. R package version 1.1. http://CRAN.R-Project.org/package=frontier.
##
## If you have questions, suggestions, or comments regarding the 'frontier' package, please use a forum or 'tracker' at frontier's R-Forge site:
## https://r-forge.r-project.org/projects/frontier/
##
## Attaching package: 'frontier'
## The following objects are masked from 'package:Benchmarking':
##
## efficiencies, sfa
sfa1 <- frontier::sfa(data=dulieu, LnGDP~LnK +LnL)
TE1 <- frontier::efficiencies(sfa1)
sfa2 <- Benchmarking::sfa(X1,Y1)
TE2 <- te.sfa(sfa2)
kqua1 <- as.data.frame( TE1, TE2)
head(kqua1)
## efficiency
## 0.927614113513862 0.9294778
## 0.930381269090945 0.9319535
## 0.921758709266478 0.9237334
## 0.937619281878483 0.9387966
## 0.926527411607347 0.9283095
## 0.946743736310203 0.9475812
library(rDEA)
## Using the GLPK callable library version 4.47
##
## Attaching package: 'rDEA'
## The following object is masked from 'package:Benchmarking':
##
## dea
dea1 <- dea(XREF=X2,YREF=Y2,X=X2, Y=Y2, model="input")
TE3 <- dea1$theta_hat
dea2 <- Benchmarking::dea(X1,Y1)
TE4 <- Benchmarking::eff(dea2)
dea.plot.frontier(X1,Y1,txt=TRUE)

kqua2 <- cbind(TE3, TE4)
head(kqua2)
## TE4
## [1,] 0.9840489
## [2,] 0.9793757
## [3,] 0.9783765
## [4,] 0.9836435
## [5,] 0.9779597
## [6,] 0.9864499