Skip to contents

Centrality-stability coefficient (case-dropping subset bootstrap)

Usage

net_stability(
  data,
  method = "glasso",
  measures = c("strength", "expected_influence"),
  centrality_fn = NULL,
  drop_prop = seq(0.1, 0.9, by = 0.1),
  iter = 100L,
  threshold = 0.7,
  certainty = 0.95,
  labels = NULL,
  estimator_args = list(),
  ...
)

Arguments

data

Data frame or matrix (rows = observations), resampled exactly as given (see net_boot()).

method

Estimator (see psychnet()). Default "glasso".

measures

Centrality measures to assess. Defaults to the two recommended for psychometric networks (c("strength", "expected_influence")); "betweenness"/"closeness" and custom measures (via centrality_fn) are also accepted. See net_centralities().

centrality_fn

Optional function supplying any non-built-in measures (see net_centralities()).

drop_prop

Proportions of cases to drop. Default seq(0.1, 0.9, 0.1).

iter

Subsets per proportion. Default 100.

threshold

Minimum acceptable rank correlation. Default 0.7.

certainty

Probability the correlation must exceed threshold. Default 0.95.

labels

Optional node labels.

estimator_args

Named list of estimator arguments. Use this for names consumed by the stability diagnostic itself, such as estimator threshold.

...

Passed to the estimator.

Value

An object of class psychnet_stability with $cs (CS-coefficient per measure) and a tidy $table (columns measure, drop_prop, mean_cor, sd_cor, prop_above) of the case-dropping correlations by drop proportion. Visualise it with plot.psychnet_stability().

Examples

set.seed(1)
x <- matrix(stats::rnorm(200 * 5), 200, 5) %*% chol(0.4^abs(outer(1:5, 1:5, "-")))
colnames(x) <- paste0("V", 1:5)
# method = "pcor" and small iter keep this example fast; the "glasso"
# default and iter = 100 are what a real analysis should use.
cs <- net_stability(x, method = "pcor", drop_prop = c(0.3, 0.6), iter = 10)
cs$cs
#>           strength expected_influence 
#>                  0                  0