# NOT RUN {
# generate network
main <- gen_net(p = 10)
# assume groups are equal
y1 <- MASS::mvrnorm(n = 500,
mu = rep(0, 10),
Sigma = main$cors)
y2 <- MASS::mvrnorm(n = 500,
mu = rep(0, 10),
Sigma = main$cors)
compare_ggms <- nct(y1, y2, iter = 500,
progress = FALSE)
compare_ggms
# custom function
# note: x & y are partial correlation networks
# correlation
Correlation <- function(x, y){
cor(x[upper.tri(x)], y[upper.tri(y)])
}
compare_ggms <- nct(y1, y2,iter = 100,
FUN = Correlation,
progress = FALSE)
compare_ggms
# correlation and strength
Strength <- function(x, y){
NetworkToolbox::strength(x) - NetworkToolbox::strength(y)
}
compare_ggms <- nct(y1, y2, iter = 100,
FUN = list(Correlation = Correlation,
Strength = Strength),
progress = FALSE)
compare_ggms
# }
Run the code above in your browser using DataLab