Skip to content

Commit

Permalink
Update network.compare.R
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Jul 11, 2024
1 parent 5148a7b commit 2802ace
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions R/network.compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ network.compare <- function(
return(
t(data.frame(
"statistic" = empirical_values,
"p.value" = colMeans(
sweep(
x = abs(permutated_values), MARGIN = 2,
STATS = empirical_values, FUN = ">="
), na.rm = TRUE
)
"p.value" = c(
mean(permutated_values[,1] <= empirical_values[1]),
mean(permutated_values[,2] <= empirical_values[2]),
mean(abs(permutated_values[,3]) >= empirical_values[3])
),
"M_permutated" = colMeans(permutated_values),
"SD_permutated" = apply(permutated_values, 2, sd)
))
)

Expand Down

0 comments on commit 2802ace

Please sign in to comment.