1. Tải gói dữ liệu

suppressMessages(library(NCA))
data(nca.example)
dulieu <- nca.example
dulieu <-data.frame(dulieu)
head(dulieu,10)
##           Individualism Risk.taking Innovation.performance
## Australia            90          84                   50.9
## Austria              55          65                   52.4
## Belgium              75          41                   75.1
## Canada               80          87                   81.4
## Czech Rep            58          61                   14.5
## Denmark              74         112                  116.3
## Finland              63          76                  173.1
## France               71          49                   77.6
## Germany              67          70                  109.5
## Greece               35          23                   12.0

2. Chạy NCA

ce_fdh: Màng bao trần fdh ( thân vỏ tàu)

cr_fdh: Hồi quy trần fdh (thân vỏ tàu)

cols: Corrected Ordinary Least Squares qr: Quantile Regression ce_vrs: Ceiling Envelopment with Varying Return to Scale cr_vrs: Ceiling Regression with Varying Return to Scale ce_fdh: Ceiling Envelopment with Free Disposal Hull cr_fdh: Ceiling Regression with Free Disposal Hull c_lp: Ceiling Linear Programming

# OK: model <- nca_analysis(dulieu,c("Individualism","Risk taking"),"Innovation performance")
# OK: model <- nca_analysis(dulieu,c(1:2),3)
model <- nca_analysis(dulieu,c(1,2),3)
model
## 
## --------------------------------------------------------------------------------
## Effect size(s):
##               ce_fdh  cr_fdh 
## Individualism 0.416   0.307  
## Risk.taking   0.309   0.282  
## --------------------------------------------------------------------------------
model1 <- nca_analysis(dulieu,c(1:2),3,ceilings=c("ce_fdh","cr_fdh", "ce_vrs", "cols","qr", "ce_vrs","cr_vrs", "c_lp"))
## 
## Warning:
## 
model1
## 
## --------------------------------------------------------------------------------
## Effect size(s):
##               ce_fdh  cr_fdh  ce_vrs  cols   qr     cr_vrs  c_lp  
## Individualism 0.416   0.307   0.255   0.156  0.163  0.310   0.163 
## Risk.taking   0.309   0.282   0.181   0.098  0.107  0.247   0.107 
## --------------------------------------------------------------------------------
model2 <- nca_analysis(dulieu,c(1:2),3,ceilings=c("ce_fdh","cr_fdh", "ce_vrs"))
model2
## 
## --------------------------------------------------------------------------------
## Effect size(s):
##               ce_fdh  cr_fdh  ce_vrs 
## Individualism 0.416   0.307   0.255  
## Risk.taking   0.309   0.282   0.181  
## --------------------------------------------------------------------------------

3. Vẽ đồ thị

Không hiển thị được trong markdown chi hiển thị trên R

nca_output(model, plots=TRUE, summaries = FALSE)
nca_output(model1, plots=TRUE, summaries = FALSE)
nca_output(model2, plots=TRUE, summaries = FALSE)

4. kết quả phân tích

nca_output(model1, plots=TRUE, summaries = TRUE)
## 
## --------------------------------------------------------------------------------
## NCA Parameters : Individualism - Innovation.performance
## --------------------------------------------------------------------------------
##                                 
## Number of observations    28    
## Scope                  15563.6  
## Xmin                      18.0  
## Xmax                      91.0  
## Ymin                       1.2  
## Ymax                     214.4  
## 
##                    ce_fdh   cr_fdh   ce_vrs      cols        qr   cr_vrs
## Ceiling zone     6466.800 4772.541 3971.600  2430.653  2534.236 4825.737
## Effect size         0.416    0.307    0.255     0.156     0.163    0.310
## # above             0        2        0         0         0        2    
## c-accuracy        100%      92.9%   100%      100%      100%      92.9% 
## Fit               100%      73.8%    61.4%     37.6%     39.2%    74.6% 
##                                                                         
## Slope                        2.230              1.206     0.951    2.225
## Intercept                   28.353            116.130   127.849   27.792
## Abs. ineff.      3000.300 6018.517 3000.300 10702.293 10495.129 5912.126
## Rel. ineff.        19.278   38.670   19.278    68.765    67.434   37.987
## Condition ineff.    0.000   10.383    0.000    13.023     0.000    9.785
## Outcome ineff.     19.278   31.565   19.278    64.088    67.434   31.260
##                       c_lp
## Ceiling zone      2534.236
## Effect size          0.163
## # above              0    
## c-accuracy         100%   
## Fit                 39.2% 
##                           
## Slope                0.951
## Intercept          127.849
## Abs. ineff.      10495.129
## Rel. ineff.         67.434
## Condition ineff.     0.000
## Outcome ineff.      67.434
## 
## 
## --------------------------------------------------------------------------------
## NCA Parameters : Risk.taking - Innovation.performance
## --------------------------------------------------------------------------------
##                                 
## Number of observations    28    
## Scope                  18974.8  
## Xmin                      23.0  
## Xmax                     112.0  
## Ymin                       1.2  
## Ymax                     214.4  
## 
##                    ce_fdh   cr_fdh   ce_vrs      cols        qr   cr_vrs
## Ceiling zone     5871.100 5348.968 3436.400  1852.392  2026.487 4689.769
## Effect size         0.309    0.282    0.181     0.098     0.107    0.247
## # above             0        1        0         0         0        1    
## c-accuracy        100%      96.4%   100%      100%      100%      96.4% 
## Fit               100%      91.1%    58.5%     31.6%     34.5%    79.9% 
##                                                                         
## Slope                        2.642              1.216     0.930    2.695
## Intercept                  -14.478            119.309   131.591   -6.569
## Abs. ineff.      5616.400 8276.863 5616.400 15270.017 14921.826 9595.263
## Rel. ineff.        29.599   43.620   29.599    80.475    78.640   50.568
## Condition ineff.   25.843   28.500   25.843    37.983    25.843   33.713
## Outcome ineff.      5.066   21.147    5.066    68.517    71.197   25.428
##                       c_lp
## Ceiling zone      2026.487
## Effect size          0.107
## # above              0    
## c-accuracy         100%   
## Fit                 34.5% 
##                           
## Slope                0.930
## Intercept          131.591
## Abs. ineff.      14921.826
## Rel. ineff.         78.640
## Condition ineff.    25.843
## Outcome ineff.      71.197

5. Test sự ổn định

model0 <- nca_analysis(dulieu,1:2,3,ceilings = "ce_fdh",test.rep = 10000)
## Do test for   : ce_fdh - Individualism
Done test for : ce_fdh - Individualism 
## Do test for   : ce_fdh - Risk.taking
Done test for : ce_fdh - Risk.taking
model0
## 
## --------------------------------------------------------------------------------
## Effect size(s):
##               ce_fdh p    
## Individualism 0.416  0.080
## Risk.taking   0.309  0.101
## --------------------------------------------------------------------------------
nca_output(model0, summaries = FALSE, test = TRUE)

6. Bảng bottlenecks

nca_output(model1, bottlenecks=TRUE ,summaries = FALSE)
## 
## --------------------------------------------------------------------------------
## Bottleneck CE-FDH (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   20.2
## 20      38.4 20.2
## 30      38.4 20.2
## 40      38.4 22.5
## 50      38.4 22.5
## 60      38.4 22.5
## 70      38.4 22.5
## 80      61.6 59.6
## 90      NA   74.2
## 100     NA   74.2
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck CR-FDH (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   NN  
## 20      NN   NN  
## 30      NN   8.0 
## 40      11.0 17.1
## 50      24.1 26.2
## 60      37.2 35.2
## 70      50.3 44.3
## 80      63.4 53.4
## 90      76.5 62.4
## 100     89.6 71.5
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck CE-VRS (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   1.5 
## 20      0.5  4.5 
## 30      6.8  7.5 
## 40      13.1 10.5
## 50      19.4 13.5
## 60      25.8 16.5
## 70      32.1 19.5
## 80      38.6 22.7
## 90      69.3 48.4
## 100     NA   74.2
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck COLS (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   NN  
## 20      NN   NN  
## 30      NN   NN  
## 40      NN   NN  
## 50      NN   NN  
## 60      NN   NN  
## 70      14.3 2.9 
## 80      38.5 22.6
## 90      62.8 42.3
## 100     87.0 62.0
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck QR (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   NN  
## 20      NN   NN  
## 30      NN   NN  
## 40      NN   NN  
## 50      NN   NN  
## 60      NN   NN  
## 70      7.9  NN  
## 80      38.6 22.7
## 90      69.3 48.4
## 100     NA   74.2
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck CR-VRS (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   NN  
## 20      NN   NN  
## 30      NN   4.1 
## 40      11.5 13.0
## 50      24.6 21.8
## 60      37.7 30.7
## 70      50.8 39.6
## 80      64.0 48.5
## 90      77.1 57.4
## 100     90.2 66.3
## 
## 
## --------------------------------------------------------------------------------
## Bottleneck C-LP (cutoff = 0)
## Y Innovation.performance (percentage.range)
## 1 Individualism          (percentage.range)
## 2 Risk.taking            (percentage.range)
## --------------------------------------------------------------------------------
## Y        1    2   
## 0       NN   NN  
## 10      NN   NN  
## 20      NN   NN  
## 30      NN   NN  
## 40      NN   NN  
## 50      NN   NN  
## 60      NN   NN  
## 70      7.9  NN  
## 80      38.6 22.7
## 90      69.3 48.4
## 100     NA   74.2
## 

7. Vẽ đồ thị

model <- nca_analysis(dulieu,1:2,3,ceilings = "ce_fdh", test.rep = 10000)
## Do test for   : ce_fdh - Individualism
Done test for : ce_fdh - Individualism 
## Do test for   : ce_fdh - Risk.taking
Done test for : ce_fdh - Risk.taking
nca_output(model, summaries = FALSE, test = TRUE)

8. Chạy basic

nca(dulieu, 1:2, 3, ceilings=c('ols', 'ce_fdh', 'cr_fdh'))
## 
## --------------------------------------------------------------------------------
## Effect size(s):
##               ce_fdh  cr_fdh 
## Individualism 0.416   0.307  
## Risk.taking   0.309   0.282  
## --------------------------------------------------------------------------------