MyNixOS website logo
Description

Calculates Composite Index.

It uses the first-order sensitivity index to measure whether the weights assigned by the creator of the composite indicator match the actual importance of the variables. Moreover, the variance inflation factor is used to reduce the set of correlated variables. In the case of a discrepancy between the importance and the assigned weight, the script determines weights that allow adjustment of the weights to the intended impact of variables. If the optimised weights are unable to reflect the desired importance, the highly correlated variables are reduced, taking into account variance inflation factor. The final outcome of the script is the calculated value of the composite indicator based on optimal weights and a reduced set of variables, and the linear ordering of the analysed objects.

Lifecycle: stable CRAN_Status_Badge

compindexR: An R package for calculating composite indicators

The package uses the first-order sensitivity index to measure whether the weights assigned by the creator of the composite indicator match the actual importance of the variables. Moreover, the variance inflation factor (VIF) is used to reduce the set of correlated variables.

In the case of a discrepancy between the importance and the assigned weight, the script determines weights that allow adjustment of the weights to the variables’ intended impact. If the optimised weights are unable to reflect the desired importance, the highly correlated variables are reduced, taking into account VIF.

The final outcome of the script is the calculated value of the composite indicator based on optimal weights and a reduced set of variables, and the linear ordering of the analysed objects.

Installing compindexR from CRAN

Please use following commands

install.packages("compindexR")
library(compindexR)

Installing compindexR - development version

Please make sure that you installed devtools package.

library(devtools)
install_github("olgnaydn/compindexR")

Example usage of the package.

  • Please make sure that you have readxl package installed. If its not installed, please install it using following commands
install.packages(readxl)
library(readxl)
  • From inst/extdata folder, import the excel file which is called cell_10.xlsx
x <- read_xlsx("cell_10.xlsx")
  • Run the following command to calculate composite indicator. Following command will allow you to choose average type as a arithmetic average, tolerance for Si calculation as 0.05, number of iterations to get Si as close to each other as possible, set VIF threshold.
calc_compindex(x, 
              avg_type = "simple", 
              scaling_method = "min-max", 
              vif_threshold = NULL, 
              si_diff = 0.005
              )

Command above will return a result as shown below

$no_of_iteration
[1] 8

$x_excluded
     [,1]                                                                                                                    
[1,] "Income share of the bottom 40 % of the population [SDG_10_50]"                                                         
[2,] "Income distribution [SDG_10_41] (Ratio)"                                                                               
[3,] "Young people neither in employment nor in education and training (NEET) [SDG_08_20A] (From 15 to 29 years, Percentage)"
[4,] "Purchasing power adjusted GDP per capita [SDG_10_10]"                                                                  
[5,] "Relative median at-risk-of-poverty gap [SDG_10_30]"                                                                    
[6,] "People at risk of income poverty after social transfers [SDG_01_20A] (Percentage, 18 years or over)"                   
[7,] "Early leavers from education and training [SDG_04_10A] (Percentage, From 18 to 24 years)"                              
[8,] "People at risk of poverty or social exclusion  [SDG_01_10A] (percentage)"                                              

$final_weights
          [,1]
[1,] 0.5251892
[2,] 0.4748108

$final_si
          [,1]
[1,] 0.4437858
[2,] 0.4437853

$final_x
[1] "Asylum applications [SDG_10_60] (per million population)"      
[2] "Employment rate [SDG_08_30A] (Percentage, From 20 to 64 years)"

$ci
 [1] 0.8257575 0.6257100 0.5613797 0.5168642 0.4739217 0.4433114 0.4137330 0.3963608
 [9] 0.3902223 0.3828151 0.3616450 0.3543244 0.3322812 0.3252506 0.3193145 0.2940342
[17] 0.2926783 0.2895374 0.2892485 0.2790355 0.2612437 0.2400609 0.2359284 0.2343469
[25] 0.2205606 0.1401317 0.0493719

Citation

First published in uRos 2022. If you use compindexR , please cite it.

Aydin, O., Kuc-Czarnecka, M., Pietrzak, M. B. & (2022). compindexR: An R package for calculating composite indicators. uRos Conference 2022. https://r-project.ro/conference2022/book-of-abstracts-uros2022.pdf

Contact

For any questions please contact:

Metadata

Version

0.1.3

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows