| rank_edges | R Documentation |
This function ranks edges based on their p-values obtained from statistical tests, ordering them from lowest to highest p-value (most to least significant). The ranking compares the stored p-values directly. For equal values it uses the optional secondary values, then upper-triangle order (second endpoint first, then first endpoint).
rank_edges(edge_pvalues, tie_values = NULL)
edge_pvalues |
A square matrix of p-values for each edge, typically obtained from |
tie_values |
Optional square numeric matrix with the same dimensions as
|
A data frame with edges and their corresponding p-values, ordered from most significant.
# Generate synthetic populations
control_graphs <- generate_category_graphs(
n_graphs = 5,
n_nodes = 10,
n_communities = 2,
base_intra_prob = 0.8,
base_inter_prob = 0.2,
seed = 1
)
patient_graphs <- generate_category_graphs(
n_graphs = 5,
n_nodes = 10,
n_communities = 2,
base_intra_prob = 0.6,
base_inter_prob = 0.4,
seed = 2
)
populations <- list(Control = control_graphs, Patient = patient_graphs)
# Compute edge frequencies
frequencies <- compute_edge_frequencies(populations)
edge_counts <- frequencies$edge_counts
N <- lengths(populations)
# Compute p-values for edge differences
edge_pvalues <- compute_edge_pvalues(edge_counts, N)
# Rank edges based on p-values
edge_df <- rank_edges(edge_pvalues)
# View the top ranked edges
head(edge_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.