dematel

This demonstration is prepared to give information about the usage of dematel package.

library(dematel)

This package contains execute_dematel(), normalize(), total_relationship_matrix(), relationships_between_criteria(), visualize(), threshold_value(), and compare_criteria() functions.

There are 3 data sets in the package named hospitaldata, nurseselection and medicaldevice respectively. These data sets gathered from book of authors “Celikbilek Y., Ozdemir M. Multi-Criteria Decision Making Methods with Annotated and Comparative Health Sciences Practices, NOBEL Academic Publication, Ankara, 2020”.

In this demonstration medicaldevice data will be used.

Medical Device Selection Data variables as follows;

and the data set;

my_data = dematel::medicaldevice

my_data
#>    K1 K2 K3 K4 K5
#> K1  0  2  4  3  4
#> K2  3  0  2  0  0
#> K3  3  3  0  0  0
#> K4  3  0  4  0  2
#> K5  4  0  2  0  0

With this data set, we can easily perform analysis using the functions included in the dematel package. The first function to use is the function called normalize_data(). normalize_data() has two parameters; first one is data and the second one is a logical value that checks whether data is matrix format. if data is not matris format then the function will not overwrite the names attribution as _C*_. The medicaldevice data set which has the structure of data.frame still can be used.

normalize_data(my_data, data_control = F)
#>         K1      K2      K3      K4      K5
#> K1 0.00000 0.15385 0.30769 0.23077 0.30769
#> K2 0.23077 0.00000 0.15385 0.00000 0.00000
#> K3 0.23077 0.23077 0.00000 0.00000 0.00000
#> K4 0.23077 0.00000 0.30769 0.00000 0.15385
#> K5 0.30769 0.00000 0.15385 0.00000 0.00000

if data_control parameter of the function is set to TRUE than the function will transform data to matrix format and overwrite names attribute as _C*_.

normalize_data(my_data, data_control = T)
#> Data converted to matrix format. Row and column names are renamed as C*
#>         C1      C2      C3      C4      C5
#> C1 0.00000 0.15385 0.30769 0.23077 0.30769
#> C2 0.23077 0.00000 0.15385 0.00000 0.00000
#> C3 0.23077 0.23077 0.00000 0.00000 0.00000
#> C4 0.23077 0.00000 0.30769 0.00000 0.15385
#> C5 0.30769 0.00000 0.15385 0.00000 0.00000

The second step of the dematel technique is to obtain the total direct relationship matrix by using the normalized matrix. The function total_relationship_matrix() is used to get the total direct relationship matrix.It is important that data_control parameter of the function should set to TRUE, otherwise function throws and error.

total_relationship_matrix(my_data, data_control = T)
#> Data converted to matrix format. Row and column names are renamed as C*
#>           C1        C2        C3         C4        C5
#> C1 0.4889668 0.3912337 0.7026745 0.34360886 0.5110044
#> C2 0.4110676 0.1448210 0.3535048 0.09486207 0.1410759
#> C3 0.4384709 0.3544754 0.2437345 0.10118594 0.1504806
#> C4 0.5593854 0.2262642 0.6075431 0.12908936 0.3458277
#> C5 0.5255989 0.1749147 0.4075545 0.12129247 0.1803824

data_control parameter of the function is pre-defined as TRUE.

total_relationship_matrix(my_data)
#> Data converted to matrix format. Row and column names are renamed as C*
#>           C1        C2        C3         C4        C5
#> C1 0.4889668 0.3912337 0.7026745 0.34360886 0.5110044
#> C2 0.4110676 0.1448210 0.3535048 0.09486207 0.1410759
#> C3 0.4384709 0.3544754 0.2437345 0.10118594 0.1504806
#> C4 0.5593854 0.2262642 0.6075431 0.12908936 0.3458277
#> C5 0.5255989 0.1749147 0.4075545 0.12129247 0.1803824

The third stage of the dematel tecnique is to obtain the relationship matrix between criteria. The relationships_between_criteria() is used to obtain the relationship matrix between criteria. By means of this function, the importance of the criteria and the situations of influence between each other are determined. (c+r) serves to determine the importance of the criteria. (c-r) is used in determining the impact of the criteria. If (c-r) <0 for a criterion, it is determined that it is affected by other criteria. Unlike; If (c-r)> 0 for a criterion, it is determined that it has an effect on other criteria. relationships_between_criteria() returns a data.frame.

Also this function has two parameters as aformentioned above data and data_control. data_control parameter of the function is pre-defined as TRUE.

relationships_between_criteria(my_data, data_control = T)
#> Data converted to matrix format. Row and column names are renamed as C*
#>          ci        ri      c+r         c-r
#> C1 2.437488 2.4234897 4.860978  0.01399868
#> C2 1.145331 1.2917091 2.437040 -0.14637765
#> C3 1.288347 2.3150114 3.603359 -1.02666409
#> C4 1.868110 0.7900387 2.658148  1.07807102
#> C5 1.409743 1.3287710 2.738514  0.08097203

The causal diagram is used to see and examine the significance and impact of the criteria more clearly. The causal diagram can be obtained with the visualize() function in the package.

Also this function has two parameters as aformentioned above data and data_control. data_control parameter of the function is pre-defined as TRUE.

visualize(my_data)
#> Data converted to matrix format. Row and column names are renamed as C*

In the diagram above, the criteria below the zero line of y axis for \(c_i-r_i\) are the criteria C2, and C3, affected by the C1, C4, and C5. The criteria above the zero line of y axis for \(c_i-r_i\) are the criteria C1, C4, and C5 that predominantly affect C2, and C3 criteria. On the \(c_i+r_i\) axis the importance of the criterion increases as you move away from zero.

The next step in the dematel technique is to create the network structure. The threshold_value() function is used to determine the threshold value. Also this function has two parameters as aformentioned above data and data_control. data_control parameter of the function is pre-defined as TRUE.

threshold_value(my_data)
#> Data converted to matrix format. Row and column names are renamed as C*
#> [1] 0.3259608

The last step of the dematel technique is to obtain comparisons. With the compare_criteria() function, relationships that exceed the threshold value in the total relationship matrix can be revealed

compare_criteria(my_data)
#> Data converted to matrix format. Row and column names are renamed as C*
#> $C1
#>        C1        C2        C3        C4        C5 
#> 0.4889668 0.3912337 0.7026745 0.3436089 0.5110044 
#> 
#> $C2
#>        C1        C3 
#> 0.4110676 0.3535048 
#> 
#> $C3
#>        C1        C2 
#> 0.4384709 0.3544754 
#> 
#> $C4
#>        C1        C3        C5 
#> 0.5593854 0.6075431 0.3458277 
#> 
#> $C5
#>        C1        C3 
#> 0.5255989 0.4075545

When the results are compared, values equal to or above the threshold value, indicate which criterion has an effect on which criteria. For instance the criterion C2 has affect on C1 with the value of 0.4110676.

dematel package has one more function called execute_dematel(). This function This function executes all functions, conducts dematel analysis at once and returns

execute_dematel() function has one parameter x. it automatically checks data type. if the data type is not matrix format then it converts it to matrix and renames the names attributes as _C*_.

execute_dematel(my_data)
#> Data converted to matrix format. Row and column names are renamed as C*
#> $data
#>    C1 C2 C3 C4 C5
#> C1  0  2  4  3  4
#> C2  3  0  2  0  0
#> C3  3  3  0  0  0
#> C4  3  0  4  0  2
#> C5  4  0  2  0  0
#> 
#> $normalized_data
#>         C1      C2      C3      C4      C5
#> C1 0.00000 0.15385 0.30769 0.23077 0.30769
#> C2 0.23077 0.00000 0.15385 0.00000 0.00000
#> C3 0.23077 0.23077 0.00000 0.00000 0.00000
#> C4 0.23077 0.00000 0.30769 0.00000 0.15385
#> C5 0.30769 0.00000 0.15385 0.00000 0.00000
#> 
#> $normalized_initial_direct_relation_matrix
#>           C1        C2        C3         C4        C5
#> C1 0.4889668 0.3912337 0.7026745 0.34360886 0.5110044
#> C2 0.4110676 0.1448210 0.3535048 0.09486207 0.1410759
#> C3 0.4384709 0.3544754 0.2437345 0.10118594 0.1504806
#> C4 0.5593854 0.2262642 0.6075431 0.12908936 0.3458277
#> C5 0.5255989 0.1749147 0.4075545 0.12129247 0.1803824
#> 
#> $relationships_between_criteria
#>          ci        ri      c+r         c-r
#> C1 2.437488 2.4234897 4.860978  0.01399868
#> C2 1.145331 1.2917091 2.437040 -0.14637765
#> C3 1.288347 2.3150114 3.603359 -1.02666409
#> C4 1.868110 0.7900387 2.658148  1.07807102
#> C5 1.409743 1.3287710 2.738514  0.08097203
#> 
#> $graph

#> 
#> $threshold_value
#> [1] 0.3259608
#> 
#> $comparison_of_criteria
#> $comparison_of_criteria$C1
#>        C1        C2        C3        C4        C5 
#> 0.4889668 0.3912337 0.7026745 0.3436089 0.5110044 
#> 
#> $comparison_of_criteria$C2
#>        C1        C3 
#> 0.4110676 0.3535048 
#> 
#> $comparison_of_criteria$C3
#>        C1        C2 
#> 0.4384709 0.3544754 
#> 
#> $comparison_of_criteria$C4
#>        C1        C3        C5 
#> 0.5593854 0.6075431 0.3458277 
#> 
#> $comparison_of_criteria$C5
#>        C1        C3 
#> 0.5255989 0.4075545