桥梁分析结果

作者

张亮,韩笑

代码
library(tidyverse)
targets::tar_load(c(avg_perf, vars_config))
group_list <- vars_config |> 
  mutate(val = row_number()) |> 
  select(group, val) |> 
  chop(val) |> 
  deframe()

数据分析说明

我们将每个人在每个测试中多个试次得分的平均作为每个人测试的实际得分。

可预测性

下面对每一次测量计算网络的可预测性指标,并可视化。

第1次测量

代码
cur_dat <- avg_perf |>
  filter(time == 1) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.848
句法成分总数 0.775
短语总数 0.955
type句法成分类型 0.592
type短语结构类型 0.961
连缀小句(分句)数 0.631
内嵌小句数 0.367
关系小句(套合)数 0.335
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第3次测量

代码
cur_dat <- avg_perf |>
  filter(time == 3) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.648
句法成分总数 0.788
短语总数 0.902
type句法成分类型 0.730
type短语结构类型 0.878
连缀小句(分句)数 0.489
内嵌小句数 0.424
关系小句(套合)数 0.259
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第4次测量

代码
cur_dat <- avg_perf |>
  filter(time == 4) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.846
句法成分总数 0.913
短语总数 0.923
type句法成分类型 0.723
type短语结构类型 0.908
连缀小句(分句)数 0.764
内嵌小句数 0.166
关系小句(套合)数 0.410
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第5次测量

代码
cur_dat <- avg_perf |>
  filter(time == 5) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.876
句法成分总数 0.833
短语总数 0.898
type句法成分类型 0.596
type短语结构类型 0.894
连缀小句(分句)数 0.626
内嵌小句数 0.289
关系小句(套合)数 0.082
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第6次测量

代码
cur_dat <- avg_perf |>
  filter(time == 6) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.865
句法成分总数 0.860
短语总数 0.935
type句法成分类型 0.549
type短语结构类型 0.910
连缀小句(分句)数 0.601
内嵌小句数 0.418
关系小句(套合)数 0.000
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第8次测量

代码
cur_dat <- avg_perf |>
  filter(time == 8) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.763
句法成分总数 0.763
短语总数 0.811
type句法成分类型 0.278
type短语结构类型 0.824
连缀小句(分句)数 0.648
内嵌小句数 0.159
关系小句(套合)数 0.225
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第9次测量

代码
cur_dat <- avg_perf |>
  filter(time == 9) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.864
句法成分总数 0.817
短语总数 0.965
type句法成分类型 0.569
type短语结构类型 0.965
连缀小句(分句)数 0.635
内嵌小句数 0.184
关系小句(套合)数 0.172
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第10次测量

代码
cur_dat <- avg_perf |>
  filter(time == 10) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.913
句法成分总数 0.899
短语总数 0.956
type句法成分类型 0.706
type短语结构类型 0.947
连缀小句(分句)数 0.775
内嵌小句数 0.472
关系小句(套合)数 0.233
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第11次测量

代码
cur_dat <- avg_perf |>
  filter(time == 11) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.863
句法成分总数 0.881
短语总数 0.916
type句法成分类型 0.596
type短语结构类型 0.923
连缀小句(分句)数 0.735
内嵌小句数 0.536
关系小句(套合)数 0.000
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第12次测量

代码
cur_dat <- avg_perf |>
  filter(time == 12) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.755
句法成分总数 0.827
短语总数 0.712
type句法成分类型 0.722
type短语结构类型 0.799
连缀小句(分句)数 0.419
内嵌小句数 0.492
关系小句(套合)数 0.000
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第13次测量

代码
cur_dat <- avg_perf |>
  filter(time == 13) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.754
句法成分总数 0.828
短语总数 0.867
type句法成分类型 0.723
type短语结构类型 0.832
连缀小句(分句)数 0.218
内嵌小句数 0.407
关系小句(套合)数 0.258
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第14次测量

代码
cur_dat <- avg_perf |>
  filter(time == 14) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.764
句法成分总数 0.819
短语总数 0.810
type句法成分类型 0.727
type短语结构类型 0.828
连缀小句(分句)数 0.530
内嵌小句数 0.471
关系小句(套合)数 0.000
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

第15次测量

代码
cur_dat <- avg_perf |>
  filter(time == 15) |>
  select(-c(time, SID)) |>
  as.matrix()
mgm_obj <- mgm::mgm(
  cur_dat,
  type = rep("g", ncol(cur_dat)),
  level = rep(1, ncol(cur_dat)),
  ruleReg = "OR",
  pbar = FALSE
)
Note that the sign of parameter estimates is stored separately; see ?mgm
代码
pred_obj <- predict(mgm_obj, data = cur_dat, errorCon = "R2")
gt::gt(pred_obj$errors)
Variable R2
T长度 0.788
句法成分总数 0.780
短语总数 0.779
type句法成分类型 0.669
type短语结构类型 0.747
连缀小句(分句)数 0.164
内嵌小句数 0.523
关系小句(套合)数 0.283
代码
network <- bootnet::estimateNetwork(
  data = cur_dat,
  default = "EBICglasso",
  tuning = 0.5,
  corMethod = "cor",
  corArgs = list( 
    method="spearman",
    use="pairwise.complete.obs"
  )
)
plot(
  network, # weighted adjacency matrix as input
  layout = 'spring',
  pie = pred_obj$error[, 2], # provide errors as input
  pieColor = rep('#377EB8', ncol(cur_dat)),
  edge.color = mgm_obj$pairwise$edgecolor,
  nodeNames = colnames(cur_dat),
  legend.mode = "style2",
  labels = seq_len(ncol(cur_dat)),
  groups = group_list
)

根据以上结果其实我们发现部分时间点中变量关系小句(套合)数的可预测性太低了,可能有一些问题,可能考虑删除这个变量。不过我们在不去掉改变量前先做一下桥梁分析。