Title: | Calculates Composite Index |
---|---|
Description: | 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. |
Authors: | Olgun Aydin [cre] |
Maintainer: | Olgun Aydin <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.1 |
Built: | 2025-02-23 03:31:40 UTC |
Source: | https://github.com/olgnaydn/compindexr |
Calculate different types of averages
calc_average(x, avg_type = "simple")
calc_average(x, avg_type = "simple")
x |
A Dataframe |
avg_type |
Choosing average type. So far "simple", "geometric" and "harmonic" average are availableç |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) calc_average(x,avg_type = "simple")
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) calc_average(x,avg_type = "simple")
Calculates composite indicator by excluding the least significant variable at each step.
calc_compindex( x, avg_type = "simple", scaling_method = "min-max", vif_based_calc = FALSE, si_diff = 0.05 )
calc_compindex( x, avg_type = "simple", scaling_method = "min-max", vif_based_calc = FALSE, si_diff = 0.05 )
x |
A Dataframe |
avg_type |
Choosing average type. So far "simple", "geometric" and "harmonic" average are available |
scaling_method |
Scaling method selection. So far "min-max" and "standardization" are available |
vif_based_calc |
If TRUE, variable with highest VIF is removed at each step. Default value is FALSE |
si_diff |
Tolerance for normalized Si calculation. Can be between 0 and 1 |
A list of lists
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) calc_compindex(x, avg_type = "simple", scaling_method = "min-max", vif_based_calc = FALSE, si_diff = 0.1)
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) calc_compindex(x, avg_type = "simple", scaling_method = "min-max", vif_based_calc = FALSE, si_diff = 0.1)
Optmization algorithm based on fmincon
ci_optimizer(x)
ci_optimizer(x)
x |
A Dataframe |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) ci_optimizer(x)
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) ci_optimizer(x)
Normalization and standardization techniques
scaling(x, method = "min-max")
scaling(x, method = "min-max")
x |
A Dataframe |
method |
Standardization or normalization technique. So far "min-max" and "standardization" are available |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) scaling(x,method = "min-max")
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) scaling(x,method = "min-max")
Calculate Si using linear method
si_linear(x, avg_type = "simple")
si_linear(x, avg_type = "simple")
x |
A Dataframe |
avg_type |
Choosing average type. So far "simple", "geometric" and "harmonic" average are availableç |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear(x,avg_type = "simple")
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear(x,avg_type = "simple")
Calculate Si using linear method by excluding Xi at each iteration while calculating Si
si_linear_exc(x, avg_type = "simple")
si_linear_exc(x, avg_type = "simple")
x |
A Dataframe |
avg_type |
Choosing average type. So far "simple", "geometric" and "harmonic" average are availableç |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear_exc(x,avg_type = "simple")
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear_exc(x,avg_type = "simple")
Calculate Si using linear method by excluding Xi using VIF
si_linear_exc_vif(x, avg_type = "simple", vif_threshold = 4.5)
si_linear_exc_vif(x, avg_type = "simple", vif_threshold = 4.5)
x |
A Dataframe |
avg_type |
Choosing average type. So far "simple", "geometric" and "harmonic" average are availableç |
vif_threshold |
Threshold for VIF. Based on this threshold variables from input data (x) are excluded for the calculations. |
A data frame
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear_exc_vif(x,avg_type = "simple", vif_threshold = 4.5)
x <- data.frame(rnorm(20),rnorm(20),rnorm(20),rnorm(20)) si_linear_exc_vif(x,avg_type = "simple", vif_threshold = 4.5)