View source: R/refine_items_by_stability.R
| refine_items_by_stability | R Documentation |
Iteratively refine items by bootstrap stability
refine_items_by_stability(
data,
threshold = 0.8,
corr = "spearman",
model = "glasso",
algorithm = "louvain",
iter = 1000,
seed_start = NULL,
type = "resampling",
ncores = 2,
max_iter = 10,
plot.itemStability = FALSE
)
data |
A data frame of items to analyze. |
threshold |
Stability threshold (default: 0.80). |
corr |
Correlation method (default: "spearman"). |
model |
Network model (default: "glasso"). |
algorithm |
Community detection algorithm (default: "louvain"). |
iter |
Number of bootstrap iterations (default: 1000). |
seed_start |
Optional starting seed. When supplied, refinement round
|
type |
Bootstrap type (default: "resampling"). |
ncores |
Number of cores for parallel processing (default: 2). |
max_iter |
Maximum number of refinement iterations (default: 10). |
plot.itemStability |
Logical; plot item stability (default: FALSE). |
A list containing the final bootstrap result, stability data, removed items, plots, and dimension consistency tables.
set.seed(123)
n <- 300
f1 <- rnorm(n)
f2 <- 0.3 * f1 + rnorm(n)
items <- data.frame(
sapply(1:4, function(i) 0.7 * f1 + rnorm(n, 0, 0.7)),
sapply(1:4, function(i) 0.7 * f2 + rnorm(n, 0, 0.7))
)
names(items) <- c(paste0("A", 1:4), paste0("B", 1:4))
refined <- refine_items_by_stability(items, corr = "pearson", iter = 20,
seed_start = 1, ncores = 1)
refined$stability_df
refined$removed_items
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.