| ggm_cfe | R Documentation |
Estimates a psychological network (GGM) from data with ceiling and/or floor effects using a two-step pairwise censored-normal correction. Step 1 corrects item means and variances via truncated-normal moment matching (Liu & Wang, 2021). Step 2 estimates pairwise latent correlations by solving the moment equation E[cov*(rho)] = observed censored covariance, evaluated using 50-point Gauss-Hermite quadrature. The corrected covariance matrix is supplied as input to EBICglasso or significance-based edge selection, preserving the standard qgraph/bootnet workflow.
ggm_cfe(
data,
floor = NULL,
ceiling = NULL,
method = "EBICglasso",
gamma = 0.5,
nlambda = 100,
lambda.min.ratio = 0.01,
threshold = FALSE,
alpha = 0.05,
verbose = TRUE
)
data |
A data frame or numeric matrix (n x p). Rows = observations, columns = variables (items/nodes). |
floor |
Floor threshold(s). Either a single value applied to all variables, or a named numeric vector with one value per column. Use NULL to indicate no floor effect. Default: NULL. |
ceiling |
Ceiling threshold(s). Same format as |
method |
Estimation method(s): "EBICglasso" (default), "FDR", "Bonferroni", or "all" to run all three. |
gamma |
EBIC hyperparameter (0 = BIC, 0.5 = default). Only used when method includes "EBICglasso". |
nlambda |
Number of tuning parameters searched by EBICglasso. Default: 100. |
lambda.min.ratio |
Smallest lambda searched, as a fraction of the
largest lambda. Passed to |
threshold |
Logical. Passed to |
alpha |
Significance level for p-value methods. Default: 0.05. |
verbose |
Logical. Print progress and diagnostics. Default: TRUE. |
An object of class "ggm_cfe" containing:
network |
Partial correlation matrix from the corrected method (primary estimator: EBICglasso or first specified method). |
network_corrected |
Partial correlation matrix from naive EBICglasso (ignoring ceiling/floor effects). |
network_naive |
Partial correlation matrix estimated from the raw (uncorrected) sample covariance using the primary method. |
networks |
Named list of partial correlation matrices for all requested methods. |
networks_corrected |
Partial correlation matrix from naive EBICglasso (ignoring ceiling/floor effects). |
networks_naive |
Named list of naive partial correlation matrices (one per requested method), estimated without ceiling/floor correction. |
Sigma_corrected |
The corrected covariance matrix (p x p). |
Sigma_naive |
The raw sample covariance matrix (p x p). |
diagnostics |
List with per-variable censoring statistics, nearPD correction magnitude, and floor/ceiling thresholds.
|
method |
Character vector of estimation method(s) run. |
gamma |
EBIC hyperparameter value used. |
nlambda |
Number of regularization parameters searched. |
lambda.min.ratio |
Smallest lambda as a fraction of the largest. |
threshold |
Logical; whether EBICglasso hard-thresholding was applied. |
alpha |
Significance level for p-value methods. |
n |
The number of observations. |
p |
The number of variables. |
varnames |
The character vector of variable (column) names. |
data |
Original data matrix. |
call |
Matched call. |
# Simulate data with ceiling effects
set.seed(42)
Y <- MASS::mvrnorm(200, rep(0,5), diag(5) + 0.3)
Y_cens <- pmin(Y, 1.0) # ceiling at 1.0 SD
fit <- ggm_cfe(Y_cens, floor=NULL, ceiling=1.0)
print(fit)
plot(fit)
# With psych::bfi personality data
# library(psych)
# fit <- ggm_cfe(bfi[,1:25], floor=1, ceiling=6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.