Skip to contents

This function computes the tefi values for two different structures using bootstrapped correlation matrices from bootEGA and compares them using a non-parametric bootstrap test. It also visualizes the distributions of tefi values for both structures.

Usage

tefi.compare(bootega.obj, base, comparison, plot.TEFI = TRUE, ...)

Arguments

bootega.obj

A bootEGA object

base

Numeric (length = columns in original dataset). A vector representing the base structure to be tested

comparison

Numeric (length = columns in original dataset). A vector representing the structure to be compared against the base structure

plot.TEFI

Boolean (length = 1). Whether the TEFI comparison and the p-value should be plotted. Defaults to TRUE

...

Additional arguments that can be passed on to plot.EGAnet. See Examples for plotting arguments

Value

A list containing:

TEFI.df

A data frame containing the TEFI values for both structures

p.value

The p-value from the non-parametric bootstrap hypothesis test

Details

The null hypothesis is that the TEFI values obtained in the bootstrapped correlation matrices for the base structure are than the TEFI values obtained in the bootstrapped correlation matrices for the comparison structure. Therefore, the p-value in this bootstrap test can be interpreted as follows:

  • If the p-value less than 0.05: TEFI values for the base structure tend to be lower than the comparison structure, indicating that the former provides a better fit (lower entropy) than the latter

  • If the p-value is greater than 0.05: TEFI values for the base structure are not significantly lower than the comparison structure, suggesting that both structures may provide similar fits or that comparison might fit better

Author

Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>

Examples

# Obtain data
wmt <- wmt2[,7:24]

if (FALSE) { # \dontrun{
# Perform bootstrap EGA
boot.wmt <- bootEGA(
  data = wmt, iter = 500,
  type = "parametric", ncores = 2
)} # }

# Perform comparison
comparing_tefi <- tefi.compare(
  boot.wmt,
  base = boot.wmt$EGA$wc, # Compare Walktrap
  comparison = community.detection(
   boot.wmt$EGA$network, algorithm = "louvain"
  ) # With Louvain
)



# Plot options (UVa colors)
plot(
  comparing_tefi,
  base.name = "Walktrap", base.color = "#232D4B",
  comparison.name = "Louvain", comparison.color = "#E57200"
)