Skip to contents

Compare TNA Clusters with Comprehensive Metrics

Usage

# S3 method for class 'group_tna'
compare(x, i = 1L, j = 2L, scaling = "none", ...)

Arguments

x

A group_tna object.

i

An integer index or the name of the principal cluster as a character string.

j

An integer index or the name of the secondary cluster as a character string.

scaling

See compare.tna().

...

Additional arguments passed to compare.tna().

Value

A tna_comparison object. See compare.tna() for details.

See also

Examples

model <- group_model(engagement_mmm)
compare(model, i = 1, j = 2)
#> Warning: There was 1 warning in `dplyr::summarize()`.
#>  In argument: `correlation = corr_fun(x, y)`.
#>  In group 1: `centrality = "Betweenness"`.
#> Caused by warning in `stats::cor()`:
#> ! the standard deviation is zero
#> Edge difference metrics
#> # A tibble: 9 × 16
#>   source     target     weight_x weight_y raw_difference absolute_difference
#>   <fct>      <fct>         <dbl>    <dbl>          <dbl>               <dbl>
#> 1 Active     Active       0.706    0.492          0.214               0.214 
#> 2 Average    Active       0.513    0.325          0.188               0.188 
#> 3 Disengaged Active       0.333    0.333          0                   0     
#> 4 Active     Average      0.294    0.442         -0.148               0.148 
#> 5 Average    Average      0.460    0.586         -0.126               0.126 
#> 6 Disengaged Average      0.381    0.573         -0.192               0.192 
#> 7 Active     Disengaged   0        0.0657        -0.0657              0.0657
#> 8 Average    Disengaged   0.0268   0.0890        -0.0622              0.0622
#> 9 Disengaged Disengaged   0.286    0.0933         0.192               0.192 
#> # ℹ 10 more variables: squared_difference <dbl>, relative_difference <dbl>,
#> #   similarity_strength_index <dbl>, difference_index <dbl>,
#> #   rank_difference <dbl>, percentile_difference <dbl>,
#> #   logarithmic_ratio <dbl>, standardized_weight_x <dbl>,
#> #   standardized_weight_y <dbl>, standardized_score_inflation <dbl>
#> 
#> Summary metrics of differences
#> # A tibble: 24 × 3
#>    category          metric               value
#>    <chr>             <chr>                <dbl>
#>  1 Weight Deviations Mean Abs. Diff.      0.132
#>  2 Weight Deviations Median Abs. Diff.    0.148
#>  3 Weight Deviations RMS Diff.            0.150
#>  4 Weight Deviations Max Abs. Diff.       0.214
#>  5 Weight Deviations Rel. Mean Abs. Diff. 0.396
#>  6 Weight Deviations CV Ratio             1.07 
#>  7 Correlations      Pearson              0.732
#>  8 Correlations      Spearman             0.733
#>  9 Correlations      Kendall              0.611
#> 10 Correlations      Distance             0.596
#> # ℹ 14 more rows
#> 
#> Network metrics
#> # A tibble: 13 × 3
#>    metric                             x     y
#>    <chr>                          <dbl> <dbl>
#>  1 Node Count                  3   e+ 0 3    
#>  2 Edge Count                  8   e+ 0 9    
#>  3 Network Density             1   e+ 0 1    
#>  4 Mean Distance               2.86e- 1 0.305
#>  5 Mean Out-Strength           1   e+ 0 1    
#>  6 SD Out-Strength             6.31e- 1 0.689
#>  7 Mean In-Strength            1   e+ 0 1    
#>  8 SD In-Strength              7.85e-17 0    
#>  9 Mean Out-Degree             2.67e+ 0 3    
#> 10 SD Out-Degree               5.77e- 1 0    
#> 11 Centralization (Out-Degree) 2.5 e- 1 0    
#> 12 Centralization (In-Degree)  2.5 e- 1 0    
#> 13 Reciprocity                 8   e- 1 1    
#> 
#> Centrality differences
#> # A tibble: 27 × 5
#>    state   centrality          x     y difference
#>    <fct>   <chr>           <dbl> <dbl>      <dbl>
#>  1 Active  OutStrength     0.294 0.508    -0.214 
#>  2 Active  InStrength      0.847 0.658     0.188 
#>  3 Active  ClosenessIn     1.44  1.52     -0.0770
#>  4 Active  ClosenessOut    1.63  1.97     -0.343 
#>  5 Active  Closeness       1.63  4.54     -2.91  
#>  6 Active  Betweenness     0     0         0     
#>  7 Active  BetweennessRSP 20     4        16     
#>  8 Active  Diffusion       0.503 0.885    -0.383 
#>  9 Active  Clustering      0.408 0.662    -0.255 
#> 10 Average OutStrength     0.540 0.414     0.126 
#> # ℹ 17 more rows
#> 
#> Centrality correlations
#> # A tibble: 9 × 3
#>   centrality     Centrality     correlation
#>   <chr>          <chr>                <dbl>
#> 1 Betweenness    Betweenness         NA    
#> 2 BetweennessRSP BetweennessRSP       0.980
#> 3 Closeness      Closeness            0.198
#> 4 ClosenessIn    ClosenessIn          0.994
#> 5 ClosenessOut   ClosenessOut         0.865
#> 6 Clustering     Clustering           0.813
#> 7 Diffusion      Diffusion            0.812
#> 8 InStrength     InStrength           0.811
#> 9 OutStrength    OutStrength          0.695