lav_fdr: False Discovery Rate (FDR) Correction for 'lavaan' parameter...

View source: R/lav_fdr.R

lav_fdrR Documentation

False Discovery Rate (FDR) Correction for 'lavaan' parameter p-values

Description

Apply a false discovery rate correction (Benjamini-Yekutieli by default) to the p-values of selected parameters from a fitted lavaan object.

Usage

lav_fdr(
  fit,
  ops = c("reg", "load", "var.cov"),
  family = c("by_group", "selected"),
  method = "BY",
  alpha = 0.05,
  standardized = c("std.all", "std.lv", "std.nox", "none")
)

## S3 method for class 'lav_fdr'
print(x, ...)

## S3 method for class 'lav_fdr'
summary(object, ...)

Arguments

fit

A fitted lavaan object.

ops

Character. One of "reg" (regressions), "load" (factor loadings), or "var.cov" (variances/covariances/residual variances). Default is "reg".

family

Character. If "selected", FDR is applied across all selected parameters jointly. If "by_group", FDR is applied separately within each group. Default is "by_group".

method

Character method passed to stats::p.adjust (default "BY").

alpha

Numeric significance threshold for adjusted p-values (default 0.05).

standardized

Which standardized column to include, or "none".

x

A 'lav_fdr' object.

...

Passed to print.lav_fdr().

object

A 'lav_fdr' object.

Details

Useful when a SEM includes many structural paths (or many other parameters of substantive interest) and there is the need to control the expected proportion of false positives among the parameters declared 'statistically significant'.

With many simultaneous tests, using p < .05 for each parameter inflates the expected number of false positives (about m * .05 under all true null hypotheses, where m is the number of tested parameters). Benjamini-Yekutieli (BY) controls the False Discovery Rate (FDR) under arbitrary dependence structures, which is suitable for SEMs where structural paths are inherently dependent through shared latent variables, covariance matrices, and model constraints.

Value

A list with:

  • fdr_table: data.frame with raw and FDR-adjusted p-values.

  • settings: list of settings used.

  • group_var: group variable name (or NULL).

  • group_labels: group labels if available.

  • call: matched call.

The returned object has class "lav_fdr".

Examples


library("lavaan")
model <- "
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
dem60 ~ ind60
dem65 ~ ind60 + dem60
y1 ~~ y5
y2 ~~ y6
"
fit <- lavaan::sem(
model = model, 
data = lavaan::PoliticalDemocracy,
std.lv = TRUE, 
estimator = "MLR", 
meanstructure = TRUE)
lav_fdr(fit = fit)


lavinteract documentation built on Feb. 12, 2026, 5:10 p.m.