Centrality-stability coefficient (case-dropping subset bootstrap)
Source:R/stability.R
net_stability.RdCentrality-stability coefficient (case-dropping subset bootstrap)
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 (viacentrality_fn) are also accepted. Seenet_centralities().- centrality_fn
Optional function supplying any non-built-in
measures(seenet_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