Learn R Programming

EGAnet (version 1.0.0)

LCT: Loadings Comparison Test

Description

An algorithm to identify whether data were generated from a factor or network model using factor and network loadings. The algorithm uses heuristics based on theory and simulation. These heuristics were then submitted to several deep learning neural networks with 240,000 samples per model with varying parameters.

Usage

LCT(
  data,
  n,
  iter = 100,
  dynamic = FALSE,
  dynamic.args = list(n.embed = 4, tau = 1, delta = 1, use.derivatives = 1)
)

Arguments

data

Matrix or data frame. A data frame with the variables to be used in the test or a correlation matrix. If the data used is a correlation matrix, the argument n will need to be specified

n

Integer. Sample size (if the data provided is a correlation matrix)

iter

Integer. Number of replicate samples to be drawn from a multivariate normal distribution (uses mvtnorm::mvrnorm). Defaults to 100

dynamic

Boolean. Is the dataset a time series where rows are time points and columns are variables? Defaults to FASLE.

dynamic.args

List. Arguments to be used in dynEGA. Defaults:

  • n.embed Number of embeddings: 4

  • tau Lag: 1

  • delta Delta: 1

  • use.derivatives Derivatives: 1

Value

Returns a list containing:

empirical

Prediction of model based on empirical dataset only

bootstrap

Prediction of model based on means of the loadings across the bootstrap replicate samples

proportion

Proportions of models suggested across bootstraps

References

Christensen, A. P., & Golino, H. (2021). Factor or network model? Predictions from neural networks. Journal of Behavioral Data Science, 1(1), 85-126.

Examples

Run this code
# NOT RUN {
# Compute LCT
## Network model
LCT(data = wmt2[,7:24])

## Factor model
LCT(data = psychTools::bfi[,1:25])

# Dynamic LCT
LCT(sim.dynEGA[sim.dynEGA$ID == 1,1:20], dynamic = TRUE)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab