build_relative_associations: Generate a relative association network

Description Usage Arguments Value missing association pairs

View source: R/relative_association_functions.R

Description

Takes as input a raw association network and normalizes it to relative-associations. Every edge's strength is transformed by dividing by the average strength of each of the variables it connects. E.g. if edge a-b has strength 1 and a's average association is 0.5 and b's average association is 0.75 that means this edge has a higher than normal weight for both nodes and its normalized strength is 1/((0.5 + 0.75)/2) = 1.6.

Usage

1
2
3
4
5
6
7
build_relative_associations(
  association_pairs,
  strength_col = "strength",
  rank_based = FALSE,
  impute_missing,
  return_imputed_pairs = TRUE
)

Arguments

association_pairs

dataframe with columns a and b representing the ids of the variables or nodes and columns strength that is a numeric indicator of strength of association (higher = stronger).

rank_based

Should the relative strength be calculated using ranks? Here instead of using the raw values of strength, the ranking of edges is used with the max "strength" being the number of edges. Set to FALSE to use the raw strengths.

impute_missing

If not all possible pairs are present in association_pairs, this parameter controls how the function deals with these missing values. Current options are "minimum"(lowest seen edge value is substituted) and zero (0 is substituted). See the section "missing association pairs" for more details.

return_imputed_pairs

If pairs were imputed to calculate averages, should those imputed pairs also be returned?

Value

A new association pairs dataframe (with columns a, b, and strength) where strength is transformed to relative strength.

missing association pairs

If there are missing pairs - I.e. not all n*(n-1)/2 combinations of variables are represented - the function will throw a warning fill in the missing values with the minimum seen association strength.

The following options are available using the impute_missing argument:


nstrayer/entropynet documentation built on Oct. 12, 2020, 2:20 a.m.