itemrest_validate: Reevaluate Prespecified Candidate Sets on Validation Data

View source: R/validation.R

itemrest_validateR Documentation

Reevaluate Prespecified Candidate Sets on Validation Data

Description

Refits discovery item sets on user-supplied validation observations, without selecting or removing additional items. The user is responsible for supplying independent observations. EFA replication and optional simple-structure CFA are distinct checks; neither automatically establishes validity. EFA computes one new correlation matrix over the union of requested retained items and uses its submatrices for those sets. Constant items fail only the sets containing them and are excluded from correlation estimation. Missing data preparation fixes rows across all discovery items before this selection. Factor congruence maximizes total absolute congruence over one-to-one factor assignments and aligns signs; Min_Congruence is descriptive, not a validity test. Identical response values are detected regardless of row names or numeric storage types or row order. Nonidentical data may still overlap; independence is not proven. Bootstrap's original-data check remains sensitive to row order.

Usage

itemrest_validate(
  x,
  data,
  solution_ids = NULL,
  method = c("efa", "cfa"),
  ordered_items = NULL,
  seed = NULL
)

Arguments

x

An itemrest_result from discovery data.

data

Numeric validation data containing every discovery item.

solution_ids

Solution_ID values. NULL evaluates candidates plus baseline.

method

"efa" (default) or "cfa". CFA requires optional lavaan and fixes each retained item's primary factor to its discovery assignment; all other cross-loadings are constrained to zero. Factors remain correlated.

ordered_items

For CFA, names of ordinal items. NULL uses integer-valued discovery items identified under cor_method = "polychoric". A character() value explicitly requests continuous treatment. Ordinal CFA uses WLSMV; continuous CFA uses MLR. Pairwise EFA uses pair counts; continuous CFA with missing = "pairwise" uses FIML, explicitly labelled in the output.

seed

Integer seed; NULL uses the local date in DDMMYYYY format.

Value

A list containing validation_summary, solution_details, data_summary, source_solution_ids, method, seed, and independence_note. CFA fit indices are descriptive and are not converted to an automatic pass/fail verdict. correlation_items, constant_items, correlation_warnings, and correlation_messages describe the validation EFA source matrix.

Examples


set.seed(1)
f <- rnorm(300)
d <- as.data.frame(replicate(4, f + rnorm(300)))
discovery <- itemrest(d[1:150, ], n_factors = 1, verbose = FALSE)
check <- itemrest_validate(discovery, d[151:300, ])


ItemRest documentation built on Oct. 6, 2026, 1:07 a.m.