# Set seed for reproducability
set.seed(789)
# select relevant variables
dybocsnet <- netdat %>% dplyr::select(dyAggression, dyTaboo, dyHoarding, dyWashing, dySymmetry, dyMisc) %>% na.omit(.)
# estimate network
ebic_dybocs <- estimateNetwork(dybocsnet,
default = "EBICglasso",
corMethod = "cor",
tuning = 0.5,
threshold = TRUE)
dybocs_var_types <- c(rep("g", 6))
dybocs_var_levels <- c(rep("1", 6))
# Estimate network using MGM to get predictability
set.seed(789)
mgm_dybocs <- mgm(dybocsnet,
type = dybocs_var_types,
level = dybocs_var_levels,
lambdaSel = "EBIC",
lambdaGam = .5,
ruleReg = "AND")
##
|
| | 0%
|
|------------ | 17%
|
|----------------------- | 33%
|
|----------------------------------- | 50%
|
|----------------------------------------------- | 67%
|
|---------------------------------------------------------- | 83%
|
|----------------------------------------------------------------------| 100%
## Note that the sign of parameter estimates is stored separately; see ?mgm
pred_mgm_dybocs <- predict(mgm_dybocs,
dybocsnet)
pred_mgm_dybocs$errors
## Variable RMSE R2
## 1 dyAggression 0.874 0.235
## 2 dyTaboo 0.919 0.155
## 3 dyHoarding 0.926 0.142
## 4 dyWashing 0.914 0.163
## 5 dySymmetry 0.859 0.261
## 6 dyMisc 0.874 0.235
# Plot network
dybocs_pie_errors <- c(pred_mgm_dybocs$errors[1:6, 3])
dybocs_node_colors <- c(rep(viridis(12, begin = 0.25, end = 0.99)[3], 6))
plot_dybocs_mgm <- qgraph(mgm_dybocs$pairwise$wadj,
layout = "spring",
repulsion = 0.9999,
title = "DY-BOCS",
pie = dybocs_pie_errors,
pieColor = viridis(12,
begin = 0.2,
end = 0.7)[3],
color = dybocs_node_colors,
labels = names(dybocsnet),
label.cex = 1,
label.scale = FALSE)
#bootnet - case for centrality stability
set.seed(789)
boot_dybocs_case<- bootnet(ebic_dybocs,
nBoots = 1000,
statistics = c("Strength"),
type = "case",
verbose = FALSE)
cor_boot_dybocs <- corStability(boot_dybocs_case)
## === Correlation Stability Analysis ===
##
## Sampling levels tested:
## nPerson Drop% n
## 1 248 75.0 103
## 2 325 67.2 105
## 3 402 59.4 109
## 4 479 51.7 106
## 5 556 43.9 101
## 6 633 36.1 106
## 7 710 28.4 93
## 8 787 20.6 85
## 9 864 12.8 102
## 10 941 5.0 90
##
## Maximum drop proportions to retain correlation of 0.7 in at least 95% of the samples:
##
## strength: 0.594
## - For more accuracy, run bootnet(..., caseMin = 0.517, caseMax = 0.672)
##
## Accuracy can also be increased by increasing both 'nBoots' and 'caseN'.
cor_boot_dybocs #betweenness not interpretable
## strength
## 0.5943491
plot_boot_dybocs_case <- plot(boot_dybocs_case, c("Strength"))
plot_boot_dybocs_case
#bootnet - nonparametric for edges and centrality significance tests
set.seed(789)
boot_dybocs<- bootnet(ebic_dybocs,
nBoots = 1000,
statistics = c("Strength","edge"),
type = "nonparametric",
verbose = FALSE)
#plot centrality CIs
plot_boot_dybocs_centrality <- plot(boot_dybocs, c("Strength"))
plot_boot_dybocs_centrality
#plot edge CIs
plot_boot_dybocs_edges <- plot(boot_dybocs, c("edge"),labels = TRUE, order="sample")
plot_boot_dybocs_edges
# Centrality plot
centralityPlot(mgm_dybocs$pairwise$wadj, labels = names(dybocsnet), include = c("Strength"), decreasing = F)
set.seed(789)
dybocsspsnet <- netdat %>% dplyr::select(spsTacPhys, spsMJB, spsLookJR, spsSoundJR, spsTactileJR,spsEmotion, dyAggression, dyTaboo, dyHoarding, dyWashing, dySymmetry, dyMisc) %>% na.omit(.)
ebic_dybocssps <- estimateNetwork(dybocsspsnet,
default = "EBICglasso",
corMethod = "cor",
tuning = 0.5,
threshold = TRUE)
dybocssps_var_types <- c(rep("g", 12))
dybocssps_var_levels <- c(rep("1", 12))
set.seed(789)
mgm_dybocssps <- mgm(dybocsspsnet,
type = dybocssps_var_types,
level = dybocssps_var_levels,
lambdaSel = "EBIC",
lambdaGam = .5,
ruleReg = "AND")
##
|
| | 0%
|
|------ | 8%
|
|------------ | 17%
|
|------------------ | 25%
|
|----------------------- | 33%
|
|----------------------------- | 42%
|
|----------------------------------- | 50%
|
|----------------------------------------- | 58%
|
|----------------------------------------------- | 67%
|
|---------------------------------------------------- | 75%
|
|---------------------------------------------------------- | 83%
|
|---------------------------------------------------------------- | 92%
|
|----------------------------------------------------------------------| 100%
## Note that the sign of parameter estimates is stored separately; see ?mgm
pred_mgm_dybocssps <- predict(mgm_dybocssps,
dybocsspsnet)
pred_mgm_dybocssps$errors
## Variable RMSE R2
## 1 spsTacPhys 0.843 0.288
## 2 spsMJB 0.927 0.140
## 3 spsLookJR 0.828 0.314
## 4 spsSoundJR 0.866 0.249
## 5 spsTactileJR 0.860 0.260
## 6 spsEmotion 0.890 0.207
## 7 dyAggression 0.877 0.229
## 8 dyTaboo 0.919 0.155
## 9 dyHoarding 0.936 0.124
## 10 dyWashing 0.905 0.180
## 11 dySymmetry 0.824 0.320
## 12 dyMisc 0.880 0.225
dybocssps_pie_errors <- c(pred_mgm_dybocssps$errors[1:12, 3])
dybocssps_node_colors <- c(rep(viridis(200, begin = 0.05, end = 0.99)[195], 6),
rep(viridis(12, begin = 0.25, end = 0.99)[3], 6))
plot_dybocssps_mgm <- qgraph(mgm_dybocssps$pairwise$wadj,
layout = "spring",
repulsion = 0.9999,
title = "DY-BOCS & USP-SPS",
pie = dybocssps_pie_errors,
pieColor = c(rep(viridis(12, begin = 0.50, end = 0.99)[12], 6),
rep(viridis(12, begin = 0.2, end = 0.7)[3], 6)),
color = dybocssps_node_colors,
labels = names(dybocsspsnet),
label.cex = 1,
label.scale = FALSE)
#bootnet - case for centrality stability
set.seed(789)
boot_dybocssps_case<- bootnet(ebic_dybocssps,
nBoots = 1000,
statistics = c("Strength"),
type = "case",
verbose = FALSE)
cor_boot_dybocssps <- corStability(boot_dybocssps_case)
## === Correlation Stability Analysis ===
##
## Sampling levels tested:
## nPerson Drop% n
## 1 248 75.0 103
## 2 325 67.2 105
## 3 402 59.4 109
## 4 479 51.7 106
## 5 556 43.9 101
## 6 633 36.1 106
## 7 710 28.4 93
## 8 787 20.6 85
## 9 864 12.8 102
## 10 941 5.0 90
##
## Maximum drop proportions to retain correlation of 0.7 in at least 95% of the samples:
##
## strength: 0.439
## - For more accuracy, run bootnet(..., caseMin = 0.361, caseMax = 0.517)
##
## Accuracy can also be increased by increasing both 'nBoots' and 'caseN'.
cor_boot_dybocssps
## strength
## 0.4389506
plot_boot_dybocssps_case <- plot(boot_dybocssps_case, c("Strength"))
plot_boot_dybocssps_case
#bootnet - nonparametric for edges and centrality significance tests
set.seed(789)
boot_dybocssps<- bootnet(ebic_dybocssps,
nBoots = 1000,
statistics = c("Strength", "edge"),
type = "nonparametric",
verbose = FALSE)
#plot centrality CIs
plot_boot_dybocssps_centrality <- plot(boot_dybocssps, c("Strength"))
plot_boot_dybocssps_centrality
#plot edge CIs
plot_boot_dybocssps_edges <- plot(boot_dybocssps, c("edge"),labels = TRUE, order="sample")
plot_boot_dybocssps_edges
# Centrality plot
centralityPlot(mgm_dybocssps$pairwise$wadj, labels = names(dybocsspsnet), include = c("Strength"), decreasing = F)
# Set seed for reproducability
set.seed(789)
# Select relevant variables
ybocsnet <- netdat %>% dplyr::select(ObsTime,ObsInterf,ObsSuffer, ObsResist, ObsCtrl,CompTime,CompInterf,CompSuffer, CompResist, CompCtrl) %>% na.omit(.)
# estimate YBOCS network
ebic_ybocs <- estimateNetwork(ybocsnet,
default = "EBICglasso",
corMethod = "cor",
tuning = 0.5,
threshold = TRUE)
ybocs_var_types <- c(rep("g", 10))
ybocs_var_levels <- c(rep("1", 10))
#estimate again using MGM to get predictability
set.seed(789)
mgm_ybocs <- mgm(ybocsnet,
type = ybocs_var_types,
level = ybocs_var_levels,
lambdaSel = "EBIC",
lambdaGam = .5,
ruleReg = "AND")
##
|
| | 0%
|
|------- | 10%
|
|-------------- | 20%
|
|--------------------- | 30%
|
|---------------------------- | 40%
|
|----------------------------------- | 50%
|
|------------------------------------------ | 60%
|
|------------------------------------------------- | 70%
|
|-------------------------------------------------------- | 80%
|
|--------------------------------------------------------------- | 90%
|
|----------------------------------------------------------------------| 100%
## Note that the sign of parameter estimates is stored separately; see ?mgm
pred_mgm_ybocs <- predict(mgm_ybocs,
ybocsnet)
pred_mgm_ybocs$errors
## Variable RMSE R2
## 1 ObsTime 0.681 0.536
## 2 ObsInterf 0.592 0.649
## 3 ObsSuffer 0.642 0.588
## 4 ObsResist 0.735 0.459
## 5 ObsCtrl 0.672 0.548
## 6 CompTime 0.606 0.632
## 7 CompInterf 0.563 0.683
## 8 CompSuffer 0.628 0.605
## 9 CompResist 0.697 0.513
## 10 CompCtrl 0.599 0.641
# Plot
ybocs_pie_errors <- c(pred_mgm_ybocs$errors[1:10, 3])
ybocs_node_colors <- c(rep(viridis(12, begin = 0.25, end = 0.99)[3], 10))
plot_ybocs_mgm <- qgraph(mgm_ybocs$pairwise$wadj,
layout = "spring",
repulsion = 0.9999,
title = "Y-BOCS",
pie = ybocs_pie_errors,
pieColor = rep(viridis(12, begin = 0.2, end = 0.7)[3], 10),
color = ybocs_node_colors,
labels = names(ybocsnet),
label.cex = 1,
label.scale = FALSE)
#bootnet - case for centrality stability
set.seed(789)
boot_ybocs_case<- bootnet(ebic_ybocs,
nBoots = 1000,
statistics = c("Strength"),
type = "case",
verbose = FALSE)
cor_boot_ybocs <- corStability(boot_ybocs_case)
## === Correlation Stability Analysis ===
##
## Sampling levels tested:
## nPerson Drop% n
## 1 248 75.0 120
## 2 325 67.3 92
## 3 403 59.4 111
## 4 480 51.7 91
## 5 557 43.9 99
## 6 634 36.2 105
## 7 712 28.3 99
## 8 789 20.5 93
## 9 866 12.8 97
## 10 943 5.0 93
##
## Maximum drop proportions to retain correlation of 0.7 in at least 95% of the samples:
##
## strength: 0.517
## - For more accuracy, run bootnet(..., caseMin = 0.439, caseMax = 0.594)
##
## Accuracy can also be increased by increasing both 'nBoots' and 'caseN'.
cor_boot_ybocs # betweenness not interpretable
## strength
## 0.5166163
plot_boot_ybocs_case <- plot(boot_ybocs_case, c("Strength"))
plot_boot_ybocs_case
#bootnet - nonparametric for edges and centrality significance tests
set.seed(789)
boot_ybocs<- bootnet(ebic_ybocs,
nBoots = 1000,
statistics = c("Strength","edge"),
type = "nonparametric",
verbose = FALSE)
#plot centrality CIs
plot_boot_ybocs_centrality <- plot(boot_ybocs, c("Strength"))
plot_boot_ybocs_centrality
#plot edge CIs
plot_boot_ybocs_edges <- plot(boot_ybocs, c("edge"),labels = TRUE, order="sample")
plot_boot_ybocs_edges
# centrality plots
centralityPlot(mgm_ybocs$pairwise$wadj, labels = names(ybocsnet), include = c("Strength"),decreasing = F)
# select Y-BOCS variables
# flip classes 2 and 3 since they are switched here
ybocsDAgrp <- netdat %>% dplyr::select(Class,ObsTime,ObsInterf,ObsSuffer, ObsResist, ObsCtrl,CompTime,CompInterf,CompSuffer, CompResist, CompCtrl) %>% na.omit(.)
ybocsDAgrp[,c(2:11)] = data.frame(sapply(ybocsDAgrp[,c(2:11)], as.numeric))
# Compute correlations:
CorGrp1 <- cor_auto(ybocsDAgrp[ybocsDAgrp$Class == 1,2:11])
CorGrp2 <- cor_auto(ybocsDAgrp[ybocsDAgrp$Class == 2,2:11])
CorGrp3 <- cor_auto(ybocsDAgrp[ybocsDAgrp$Class == 3,2:11])
CorGrp4 <- cor_auto(ybocsDAgrp[ybocsDAgrp$Class == 4,2:11])
set.seed(789)
#OCDGrpNetBayes <- EstimateGroupNetwork(list(grp1 = CorGrp1, grp2 = CorGrp2, grp3 = CorGrp3, grp4 = CorGrp4), n = c(sum(ybocsDAgrp$Class == 1),sum(ybocsDAgrp$Class == 2),sum(ybocsDAgrp$Class == 3), sum(ybocsDAgrp$Class == 4)))
#save(OCDGrpNetBayes, file = "OCDGrpNetBayes.Rdata")
# Load in model results (takes forever to re-run) and plot
load("OCDGrpNetBayes.Rdata")
Layout <- averageLayout(OCDGrpNetBayes$grp1,OCDGrpNetBayes$grp2, OCDGrpNetBayes$grp3, OCDGrpNetBayes$grp4)
layout(t(1:4))
ybocs_node_colors <- c(rep(viridis(12, begin = 0.25, end = 0.99)[3], 10))
cluster1plot <- qgraph(OCDGrpNetBayes$grp1, layout = Layout,
title = "Class 1",
color = ybocs_node_colors,
labels = names(ybocsDAgrp[,c(2:11)]),
label.cex = 1,
label.scale = FALSE)
cluster2plot <- qgraph(OCDGrpNetBayes$grp2, layout = Layout,
title = "Class 2",
color = ybocs_node_colors,
labels = names(ybocsDAgrp[,c(2:11)]),
label.cex = 1,
label.scale = FALSE)
cluster3plot <- qgraph(OCDGrpNetBayes$grp3, layout = Layout,
title = "Class 3",
color = ybocs_node_colors,
labels = names(ybocsDAgrp[,c(2:11)]),
label.cex = 1,
label.scale = FALSE)
cluster4plot <- qgraph(OCDGrpNetBayes$grp4, layout = Layout,
title = "Class 4",
color = ybocs_node_colors,
labels = names(ybocsDAgrp[,c(2:11)]),
label.cex = 1,
label.scale = FALSE)
# centrality plot
centralityPlot(OCDGrpNetBayes, include = c("Strength"))
# Class 1 vs Class 2
set.seed(789)
class1v2 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 1,2:11], ybocsDAgrp[ybocsDAgrp$Class == 2,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class1v2
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.2131145
## p-value 0.08
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.677079 4.634644
## Test statistic S: 0.04243547
## p-value 0.85
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 1.000
## 21 ObsTime ObsSuffer 1.000
## 22 ObsInterf ObsSuffer 0.394
## 31 ObsTime ObsResist 0.321
## 32 ObsInterf ObsResist 0.943
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 0.943
## 42 ObsInterf ObsCtrl 0.660
## 43 ObsSuffer ObsCtrl 0.300
## 44 ObsResist ObsCtrl 1.000
## 51 ObsTime CompTime 0.943
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 0.943
## 61 ObsTime CompInterf 1.000
## 62 ObsInterf CompInterf 0.000
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 0.660
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 0.660
## 71 ObsTime CompSuffer 1.000
## 72 ObsInterf CompSuffer 1.000
## 73 ObsSuffer CompSuffer 0.660
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 1.000
## 76 CompTime CompSuffer 0.943
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 0.660
## 82 ObsInterf CompResist 1.000
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 0.959
## 85 ObsCtrl CompResist 0.660
## 86 CompTime CompResist 0.180
## 87 CompInterf CompResist 1.000
## 88 CompSuffer CompResist 1.000
## 91 ObsTime CompCtrl 0.180
## 92 ObsInterf CompCtrl 0.660
## 93 ObsSuffer CompCtrl 1.000
## 94 ObsResist CompCtrl 1.000
## 95 ObsCtrl CompCtrl 0.180
## 96 CompTime CompCtrl 0.959
## 97 CompInterf CompCtrl 0.000
## 98 CompSuffer CompCtrl 1.000
## 99 CompResist CompCtrl 0.943
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.9052632 0.9900000
## ObsInterf 0.9052632 0.9052632
## ObsSuffer 0.9052632 0.3000000
## ObsResist 0.9052632 0.9052632
## ObsCtrl 0.9052632 0.9052632
## CompTime 0.9052632 0.9052632
## CompInterf 0.9052632 0.9052632
## CompSuffer 0.9052632 0.9052632
## CompResist 0.9052632 0.9052632
## CompCtrl 0.9052632 0.0000000
class1v2$diffcen.real
## strength expectedInfluence
## ObsTime -0.01810342 0.002635077
## ObsInterf -0.02023238 0.031551790
## ObsSuffer -0.14471710 -0.188665324
## ObsResist 0.06541553 0.027554756
## ObsCtrl 0.03155972 0.018636545
## CompTime -0.06939803 -0.069398035
## CompInterf 0.04207853 0.042078528
## CompSuffer 0.03247435 0.032474353
## CompResist 0.11272867 -0.038473805
## CompCtrl 0.05306508 0.257779589
# Class 1 vs Class 3
set.seed(789)
class1v3 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 1,2:11], ybocsDAgrp[ybocsDAgrp$Class == 3,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class1v3$einv.real
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.000000000 0.05481979 0.02226377 0.05017661 0.136215292 0.04086715
## [2,] 0.054819787 0.00000000 0.06135711 0.03230321 0.125149730 0.00000000
## [3,] 0.022263769 0.06135711 0.00000000 0.00000000 0.063024407 0.00000000
## [4,] 0.050176610 0.03230321 0.00000000 0.00000000 0.094918276 0.00000000
## [5,] 0.136215292 0.12514973 0.06302441 0.09491828 0.000000000 0.01327437
## [6,] 0.040867151 0.00000000 0.00000000 0.00000000 0.013274371 0.00000000
## [7,] 0.000000000 0.15046993 0.00000000 0.03099185 0.000000000 0.08210957
## [8,] 0.019163095 0.02890643 0.07406134 0.00000000 0.055236074 0.06838281
## [9,] 0.047165538 0.03558293 0.02197411 0.09946381 0.006461586 0.00000000
## [10,] 0.004299153 0.00000000 0.01973192 0.00000000 0.094828420 0.09939585
## [,7] [,8] [,9] [,10]
## [1,] 0.00000000 0.01916309 0.047165538 0.004299153
## [2,] 0.15046993 0.02890643 0.035582932 0.000000000
## [3,] 0.00000000 0.07406134 0.021974111 0.019731916
## [4,] 0.03099185 0.00000000 0.099463811 0.000000000
## [5,] 0.00000000 0.05523607 0.006461586 0.094828420
## [6,] 0.08210957 0.06838281 0.000000000 0.099395846
## [7,] 0.00000000 0.01893242 0.000000000 0.047256427
## [8,] 0.01893242 0.00000000 0.000000000 0.070864489
## [9,] 0.00000000 0.00000000 0.000000000 0.040794125
## [10,] 0.04725643 0.07086449 0.040794125 0.000000000
class1v3
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.1504699
## p-value 0.46
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.677079 4.529255
## Test statistic S: 0.1478237
## p-value 0.62
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 0.919
## 21 ObsTime ObsSuffer 1.000
## 22 ObsInterf ObsSuffer 0.832
## 31 ObsTime ObsResist 0.337
## 32 ObsInterf ObsResist 1.000
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 0.525
## 42 ObsInterf ObsCtrl 0.000
## 43 ObsSuffer ObsCtrl 0.919
## 44 ObsResist ObsCtrl 0.821
## 51 ObsTime CompTime 0.980
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 0.821
## 61 ObsTime CompInterf 1.000
## 62 ObsInterf CompInterf 0.337
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 0.821
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 0.821
## 71 ObsTime CompSuffer 0.821
## 72 ObsInterf CompSuffer 0.337
## 73 ObsSuffer CompSuffer 0.832
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 0.821
## 76 CompTime CompSuffer 0.821
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 0.857
## 82 ObsInterf CompResist 0.952
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 0.821
## 85 ObsCtrl CompResist 0.919
## 86 CompTime CompResist 1.000
## 87 CompInterf CompResist 1.000
## 88 CompSuffer CompResist 1.000
## 91 ObsTime CompCtrl 0.936
## 92 ObsInterf CompCtrl 1.000
## 93 ObsSuffer CompCtrl 0.825
## 94 ObsResist CompCtrl 1.000
## 95 ObsCtrl CompCtrl 0.821
## 96 CompTime CompCtrl 0.450
## 97 CompInterf CompCtrl 0.821
## 98 CompSuffer CompCtrl 0.821
## 99 CompResist CompCtrl 0.980
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.9090909 0.9800000
## ObsInterf 0.6333333 0.6333333
## ObsSuffer 0.9800000 0.6857143
## ObsResist 0.9800000 0.9166667
## ObsCtrl 0.9800000 0.9800000
## CompTime 0.9800000 0.9800000
## CompInterf 0.8222222 0.7250000
## CompSuffer 0.6333333 0.6333333
## CompResist 0.9090909 0.9800000
## CompCtrl 0.6333333 0.6333333
# Class 1 vs Class 4
set.seed(789)
class1v4 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 1,2:11], ybocsDAgrp[ybocsDAgrp$Class == 4,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class1v4$einv.real
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.00000000 0.210229894 0.185906319 0.067733978 0.05954255 0.323059598
## [2,] 0.21022989 0.000000000 0.007229646 0.000000000 0.00000000 0.000000000
## [3,] 0.18590632 0.007229646 0.000000000 0.000000000 0.02460273 0.000000000
## [4,] 0.06773398 0.000000000 0.000000000 0.000000000 0.07293463 0.000878905
## [5,] 0.05954255 0.000000000 0.024602732 0.072934633 0.00000000 0.013274371
## [6,] 0.32305960 0.000000000 0.000000000 0.000878905 0.01327437 0.000000000
## [7,] 0.01331442 0.048173920 0.000000000 0.030991854 0.00000000 0.052013485
## [8,] 0.11055174 0.045219704 0.001992606 0.000000000 0.02223353 0.005963492
## [9,] 0.04716554 0.000000000 0.021974111 0.080341542 0.02550174 0.038678531
## [10,] 0.00000000 0.000000000 0.000000000 0.023125845 0.02734665 0.028602636
## [,7] [,8] [,9] [,10]
## [1,] 0.01331442 0.110551740 0.04716554 0.00000000
## [2,] 0.04817392 0.045219704 0.00000000 0.00000000
## [3,] 0.00000000 0.001992606 0.02197411 0.00000000
## [4,] 0.03099185 0.000000000 0.08034154 0.02312585
## [5,] 0.00000000 0.022233528 0.02550174 0.02734665
## [6,] 0.05201348 0.005963492 0.03867853 0.02860264
## [7,] 0.00000000 0.054304074 0.03122148 0.01451899
## [8,] 0.05430407 0.000000000 0.00000000 0.12802276
## [9,] 0.03122148 0.000000000 0.00000000 0.09759687
## [10,] 0.01451899 0.128022757 0.09759687 0.00000000
class1v4$diffcen.real
## strength expectedInfluence
## ObsTime 0.251704740 0.11951289
## ObsInterf -0.214505324 -0.21450532
## ObsSuffer 0.227246122 0.18329790
## ObsResist -0.030293011 -0.06815378
## ObsCtrl 0.162888837 0.14996566
## CompTime 0.222123904 0.22212390
## CompInterf 0.051439442 0.05143944
## CompSuffer 0.012277957 0.01227796
## CompResist 0.003916398 -0.14728607
## CompCtrl 0.215756780 0.21575678
class1v4
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.3230596
## p-value 0.01
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.677079 4.225801
## Test statistic S: 0.4512779
## p-value 0.09
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 0.450
## 21 ObsTime ObsSuffer 0.638
## 22 ObsInterf ObsSuffer 1.000
## 31 ObsTime ObsResist 0.638
## 32 ObsInterf ObsResist 1.000
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 1.000
## 42 ObsInterf ObsCtrl 1.000
## 43 ObsSuffer ObsCtrl 1.000
## 44 ObsResist ObsCtrl 1.000
## 51 ObsTime CompTime 0.000
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 1.000
## 61 ObsTime CompInterf 0.638
## 62 ObsInterf CompInterf 1.000
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 0.870
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 1.000
## 71 ObsTime CompSuffer 0.450
## 72 ObsInterf CompSuffer 0.638
## 73 ObsSuffer CompSuffer 1.000
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 1.000
## 76 CompTime CompSuffer 1.000
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 0.865
## 82 ObsInterf CompResist 1.000
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 1.000
## 85 ObsCtrl CompResist 0.638
## 86 CompTime CompResist 0.638
## 87 CompInterf CompResist 0.638
## 88 CompSuffer CompResist 1.000
## 91 ObsTime CompCtrl 1.000
## 92 ObsInterf CompCtrl 1.000
## 93 ObsSuffer CompCtrl 1.000
## 94 ObsResist CompCtrl 0.638
## 95 ObsCtrl CompCtrl 1.000
## 96 CompTime CompCtrl 1.000
## 97 CompInterf CompCtrl 1.000
## 98 CompSuffer CompCtrl 0.638
## 99 CompResist CompCtrl 0.868
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.2857143 0.5076923
## ObsInterf 0.2857143 0.2400000
## ObsSuffer 0.3555556 0.4000000
## ObsResist 0.9263158 0.7000000
## ObsCtrl 0.4166667 0.4000000
## CompTime 0.1333333 0.1333333
## CompInterf 0.8000000 0.8000000
## CompSuffer 0.9263158 0.9263158
## CompResist 0.9900000 0.3500000
## CompCtrl 0.1500000 0.0000000
# Class 2 vs Class 3
set.seed(789)
class2v3 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 2,2:11], ybocsDAgrp[ybocsDAgrp$Class == 3,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class2v3
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.1912176
## p-value 0.19
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.634644 4.529255
## Test statistic S: 0.1053882
## p-value 0.56
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 1.000
## 21 ObsTime ObsSuffer 1.000
## 22 ObsInterf ObsSuffer 1.000
## 31 ObsTime ObsResist 1.000
## 32 ObsInterf ObsResist 1.000
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 0.000
## 42 ObsInterf ObsCtrl 1.000
## 43 ObsSuffer ObsCtrl 1.000
## 44 ObsResist ObsCtrl 0.540
## 51 ObsTime CompTime 1.000
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 1.000
## 61 ObsTime CompInterf 1.000
## 62 ObsInterf CompInterf 1.000
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 1.000
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 1.000
## 71 ObsTime CompSuffer 1.000
## 72 ObsInterf CompSuffer 1.000
## 73 ObsSuffer CompSuffer 1.000
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 0.540
## 76 CompTime CompSuffer 1.000
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 1.000
## 82 ObsInterf CompResist 1.000
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 1.000
## 85 ObsCtrl CompResist 1.000
## 86 CompTime CompResist 1.000
## 87 CompInterf CompResist 1.000
## 88 CompSuffer CompResist 0.990
## 91 ObsTime CompCtrl 0.540
## 92 ObsInterf CompCtrl 1.000
## 93 ObsSuffer CompCtrl 0.540
## 94 ObsResist CompCtrl 1.000
## 95 ObsCtrl CompCtrl 0.990
## 96 CompTime CompCtrl 1.000
## 97 CompInterf CompCtrl 0.825
## 98 CompSuffer CompCtrl 0.990
## 99 CompResist CompCtrl 0.990
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.80 0.9058824
## ObsInterf 0.80 0.8000000
## ObsSuffer 0.80 0.8000000
## ObsResist 0.80 0.8000000
## ObsCtrl 0.94 0.9400000
## CompTime 0.80 0.8000000
## CompInterf 0.90 0.9000000
## CompSuffer 0.80 0.8000000
## CompResist 0.94 0.8000000
## CompCtrl 0.80 0.8000000
class2v3$einv.real
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.00000000 0.075953636 0.03392182 0.010357283 0.19121756 0.015212549
## [2,] 0.07595364 0.000000000 0.06568340 0.004436791 0.07036699 0.000000000
## [3,] 0.03392182 0.065683396 0.00000000 0.000000000 0.08429784 0.000000000
## [4,] 0.01035728 0.004436791 0.00000000 0.000000000 0.14427047 0.001488256
## [5,] 0.19121756 0.070366992 0.08429784 0.144270466 0.00000000 0.000000000
## [6,] 0.01521255 0.000000000 0.00000000 0.001488256 0.00000000 0.000000000
## [7,] 0.00000000 0.052619170 0.00000000 0.000000000 0.00000000 0.007832696
## [8,] 0.01916309 0.028906425 0.02195215 0.000000000 0.04877172 0.006609706
## [9,] 0.00000000 0.035582932 0.00000000 0.053490951 0.00000000 0.048391156
## [10,] 0.08076432 0.025892083 0.01973192 0.000000000 0.11828604 0.052218563
## [,7] [,8] [,9] [,10]
## [1,] 0.000000000 0.019163095 0.00000000 0.08076432
## [2,] 0.052619170 0.028906425 0.03558293 0.02589208
## [3,] 0.000000000 0.021952146 0.00000000 0.01973192
## [4,] 0.000000000 0.000000000 0.05349095 0.00000000
## [5,] 0.000000000 0.048771723 0.00000000 0.11828604
## [6,] 0.007832696 0.006609706 0.04839116 0.05221856
## [7,] 0.000000000 0.014754951 0.00000000 0.10415650
## [8,] 0.014754951 0.000000000 0.02445777 0.08832447
## [9,] 0.000000000 0.024457773 0.00000000 0.10479763
## [10,] 0.104156505 0.088324469 0.10479763 0.00000000
# Class 2 vs Class 4
set.seed(789)
class2v4 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 2,2:11], ybocsDAgrp[ybocsDAgrp$Class == 4,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class2v4
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.2669799
## p-value 0.17
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.634644 4.225801
## Test statistic S: 0.4088424
## p-value 0.24
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 0.450
## 21 ObsTime ObsSuffer 0.614
## 22 ObsInterf ObsSuffer 0.762
## 31 ObsTime ObsResist 1.000
## 32 ObsInterf ObsResist 1.000
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 0.840
## 42 ObsInterf ObsCtrl 1.000
## 43 ObsSuffer ObsCtrl 0.614
## 44 ObsResist ObsCtrl 1.000
## 51 ObsTime CompTime 0.000
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 1.000
## 61 ObsTime CompInterf 0.614
## 62 ObsInterf CompInterf 0.762
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 1.000
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 1.000
## 71 ObsTime CompSuffer 0.614
## 72 ObsInterf CompSuffer 1.000
## 73 ObsSuffer CompSuffer 0.872
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 1.000
## 76 CompTime CompSuffer 1.000
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 1.000
## 82 ObsInterf CompResist 1.000
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 0.836
## 85 ObsCtrl CompResist 1.000
## 86 CompTime CompResist 1.000
## 87 CompInterf CompResist 0.614
## 88 CompSuffer CompResist 0.614
## 91 ObsTime CompCtrl 0.953
## 92 ObsInterf CompCtrl 1.000
## 93 ObsSuffer CompCtrl 1.000
## 94 ObsResist CompCtrl 1.000
## 95 ObsCtrl CompCtrl 0.614
## 96 CompTime CompCtrl 1.000
## 97 CompInterf CompCtrl 0.614
## 98 CompSuffer CompCtrl 0.614
## 99 CompResist CompCtrl 1.000
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.5111111 0.5272727
## ObsInterf 0.5111111 0.2400000
## ObsSuffer 0.0000000 0.0000000
## ObsResist 0.6714286 0.6714286
## ObsCtrl 0.5111111 0.5111111
## CompTime 0.0000000 0.0000000
## CompInterf 0.9700000 0.9700000
## CompSuffer 0.9666667 0.9666667
## CompResist 0.5333333 0.5272727
## CompCtrl 0.6933333 0.9250000
class2v4$diffcen.real
## strength expectedInfluence
## ObsTime 0.269808155 0.116877814
## ObsInterf -0.194272948 -0.246057115
## ObsSuffer 0.371963223 0.371963223
## ObsResist -0.095708538 -0.095708538
## ObsCtrl 0.131329120 0.131329120
## CompTime 0.291521938 0.291521938
## CompInterf 0.009360914 0.009360914
## CompSuffer -0.020196396 -0.020196396
## CompResist -0.108812269 -0.108812269
## CompCtrl 0.162691699 -0.042022809
class2v4$einv.real
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.000000000 0.23136374 0.17424827 0.0072000844 0.11454481 0.2669798983
## [2,] 0.231363743 0.00000000 0.11981086 0.0367399990 0.05478274 0.0000000000
## [3,] 0.174248266 0.11981086 0.00000000 0.0000000000 0.17192498 0.0000000000
## [4,] 0.007200084 0.03674000 0.00000000 0.0000000000 0.02358244 0.0006093514
## [5,] 0.114544812 0.05478274 0.17192498 0.0235824429 0.00000000 0.0000000000
## [6,] 0.266979898 0.00000000 0.00000000 0.0006093514 0.00000000 0.0000000000
## [7,] 0.013314425 0.15491518 0.00000000 0.0000000000 0.00000000 0.0222633864
## [8,] 0.110551740 0.04521970 0.09402088 0.0000000000 0.02869788 0.0677365960
## [9,] 0.000000000 0.00000000 0.00000000 0.1263144022 0.01904015 0.0097126253
## [10,] 0.076465171 0.02589208 0.00000000 0.0231258451 0.18576782 0.0757799189
## [,7] [,8] [,9] [,10]
## [1,] 0.01331442 0.11055174 0.000000000 0.07646517
## [2,] 0.15491518 0.04521970 0.000000000 0.02589208
## [3,] 0.00000000 0.09402088 0.000000000 0.00000000
## [4,] 0.00000000 0.00000000 0.126314402 0.02312585
## [5,] 0.00000000 0.02869788 0.019040151 0.18576782
## [6,] 0.02226339 0.06773660 0.009712625 0.07577992
## [7,] 0.00000000 0.02061670 0.031221485 0.16593192
## [8,] 0.02061670 0.00000000 0.024457773 0.14548274
## [9,] 0.03122148 0.02445777 0.000000000 0.03359337
## [10,] 0.16593192 0.14548274 0.033593371 0.00000000
# Class 3 vs Class 4
set.seed(789)
class3v4 <- NetworkComparisonTest::NCT(ybocsDAgrp[ybocsDAgrp$Class == 3,2:11], ybocsDAgrp[ybocsDAgrp$Class == 4,2:11], test.edges = T, test.centrality = T, p.adjust.methods = "BH")
##
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|====== | 8%
|
|====== | 9%
|
|======= | 10%
|
|======== | 11%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============= | 18%
|
|============= | 19%
|
|============== | 20%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 23%
|
|================= | 24%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 30%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 40%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 50%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 60%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 70%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 80%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 90%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 100%
class3v4
##
## NETWORK INVARIANCE TEST
## Test statistic M: 0.2821924
## p-value 0.04
##
## GLOBAL STRENGTH INVARIANCE TEST
## Global strength per group: 4.529255 4.225801
## Test statistic S: 0.3034543
## p-value 0.22
##
## EDGE INVARIANCE TEST
##
## Var1 Var2 p-value
## 11 ObsTime ObsInterf 0.585
## 21 ObsTime ObsSuffer 0.585
## 22 ObsInterf ObsSuffer 0.938
## 31 ObsTime ObsResist 1.000
## 32 ObsInterf ObsResist 0.948
## 33 ObsSuffer ObsResist 1.000
## 41 ObsTime ObsCtrl 0.585
## 42 ObsInterf ObsCtrl 0.585
## 43 ObsSuffer ObsCtrl 0.938
## 44 ObsResist ObsCtrl 0.585
## 51 ObsTime CompTime 0.000
## 52 ObsInterf CompTime 1.000
## 53 ObsSuffer CompTime 1.000
## 54 ObsResist CompTime 1.000
## 55 ObsCtrl CompTime 1.000
## 61 ObsTime CompInterf 0.739
## 62 ObsInterf CompInterf 0.874
## 63 ObsSuffer CompInterf 1.000
## 64 ObsResist CompInterf 1.000
## 65 ObsCtrl CompInterf 1.000
## 66 CompTime CompInterf 1.000
## 71 ObsTime CompSuffer 0.900
## 72 ObsInterf CompSuffer 1.000
## 73 ObsSuffer CompSuffer 0.938
## 74 ObsResist CompSuffer 1.000
## 75 ObsCtrl CompSuffer 0.585
## 76 CompTime CompSuffer 0.938
## 77 CompInterf CompSuffer 1.000
## 81 ObsTime CompResist 1.000
## 82 ObsInterf CompResist 0.870
## 83 ObsSuffer CompResist 1.000
## 84 ObsResist CompResist 0.585
## 85 ObsCtrl CompResist 0.623
## 86 CompTime CompResist 0.900
## 87 CompInterf CompResist 0.585
## 88 CompSuffer CompResist 1.000
## 91 ObsTime CompCtrl 0.872
## 92 ObsInterf CompCtrl 1.000
## 93 ObsSuffer CompCtrl 0.938
## 94 ObsResist CompCtrl 0.585
## 95 ObsCtrl CompCtrl 0.948
## 96 CompTime CompCtrl 0.623
## 97 CompInterf CompCtrl 0.948
## 98 CompSuffer CompCtrl 0.948
## 99 CompResist CompCtrl 0.623
##
## CENTRALITY INVARIANCE TEST
##
## strength expectedInfluence
## ObsTime 0.5333333 0.5333333
## ObsInterf 0.8400000 0.6600000
## ObsSuffer 0.5200000 0.5200000
## ObsResist 0.8400000 0.8400000
## ObsCtrl 0.5333333 0.5333333
## CompTime 0.5200000 0.5200000
## CompInterf 0.8400000 0.8400000
## CompSuffer 0.7571429 0.7571429
## CompResist 0.7454545 0.5200000
## CompCtrl 0.8400000 0.7571429
class3v4$einv.real
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.000000000 0.15541011 0.20817009 0.017557368 0.07667274 0.282192448
## [2,] 0.155410107 0.00000000 0.05412747 0.032303208 0.12514973 0.000000000
## [3,] 0.208170088 0.05412747 0.00000000 0.000000000 0.08762714 0.000000000
## [4,] 0.017557368 0.03230321 0.00000000 0.000000000 0.16785291 0.000878905
## [5,] 0.076672744 0.12514973 0.08762714 0.167852909 0.00000000 0.000000000
## [6,] 0.282192448 0.00000000 0.00000000 0.000878905 0.00000000 0.000000000
## [7,] 0.013314425 0.10229601 0.00000000 0.000000000 0.00000000 0.030096083
## [8,] 0.091388645 0.01631328 0.07206873 0.000000000 0.07746960 0.074346302
## [9,] 0.000000000 0.03558293 0.00000000 0.179805353 0.01904015 0.038678531
## [10,] 0.004299153 0.00000000 0.01973192 0.023125845 0.06748177 0.127998482
## [,7] [,8] [,9] [,10]
## [1,] 0.01331442 0.09138864 0.00000000 0.004299153
## [2,] 0.10229601 0.01631328 0.03558293 0.000000000
## [3,] 0.00000000 0.07206873 0.00000000 0.019731916
## [4,] 0.00000000 0.00000000 0.17980535 0.023125845
## [5,] 0.00000000 0.07746960 0.01904015 0.067481775
## [6,] 0.03009608 0.07434630 0.03867853 0.127998482
## [7,] 0.00000000 0.03537165 0.03122148 0.061775414
## [8,] 0.03537165 0.00000000 0.00000000 0.057158268
## [9,] 0.03122148 0.00000000 0.00000000 0.138390997
## [10,] 0.06177541 0.05715827 0.13839100 0.000000000
library(doBy)
summaryBy(YBOCSOB ~ Class, data=netdat, na.rm=T, FUN = c(mean, sd))
## Class YBOCSOB.mean YBOCSOB.sd
## 1 1 12.61589 3.926641
## 2 2 12.30093 4.033257
## 3 3 12.69907 4.085960
## 4 4 13.72222 3.306276
summaryBy(YBOCSCOM ~ Class, data=netdat, na.rm=T, FUN = c(mean, sd))
## Class YBOCSCOM.mean YBOCSCOM.sd
## 1 1 12.60927 4.320112
## 2 2 12.04167 4.218798
## 3 3 13.61111 3.710032
## 4 4 14.02778 3.492203
summary(aov(YBOCSOB ~ Class, data=netdat))
## Df Sum Sq Mean Sq F value Pr(>F)
## Class 1 61 60.67 3.926 0.0478 *
## Residuals 991 15315 15.45
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pairwise.t.test(netdat$YBOCSOB, netdat$Class, p.adj = "bonf")
##
## Pairwise comparisons using t tests with pooled SD
##
## data: netdat$YBOCSOB and netdat$Class
##
## 1 2 3
## 2 1.000 - -
## 3 1.000 1.000 -
## 4 0.052 0.013 0.163
##
## P value adjustment method: bonferroni
summary(aov(YBOCSCOM ~ Class, data=netdat))
## Df Sum Sq Mean Sq F value Pr(>F)
## Class 1 253 253.33 15.02 0.000113 ***
## Residuals 991 16716 16.87
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pairwise.t.test(netdat$YBOCSCOM, netdat$Class, p.adj = "bonf")
##
## Pairwise comparisons using t tests with pooled SD
##
## data: netdat$YBOCSCOM and netdat$Class
##
## 1 2 3
## 2 0.56052 - -
## 3 0.01866 0.00043 -
## 4 0.00740 0.00024 1.00000
##
## P value adjustment method: bonferroni