Learn R Programming

EGAnet (version 1.1.0)

invariance: Measurement Invariance of EGA Structure

Description

Estimates metric invariance of EGA or specified structure

Usage

invariance(
  data,
  groups,
  memberships = NULL,
  type = c("loadings"),
  iter = 500,
  ncores,
  ...
)

Value

Returns a list containing:

memberships

Original memberships provided in memberships or from EGA if NULL

EGA

Original EGA results for the sample

groups

  • EGA EGA results for each group

  • loadings Network loadings for each group

  • loadingsDifference Difference between the dominant loadings of each group

permutation

  • groups Permutated groups acorss iterations

  • loadings Loadings for each group for each permutation

  • loadingsDifference Difference between the dominant loadings of each group for each permutation

results

Data frame of the results (which are printed)

Arguments

data

Matrix or data frame. Variables to be used in the analysis

groups

Vector. Group membership corresponding to each case in data

memberships

Vector. Node membership for each community or factor. Defaults to NULL. When NULL, EGA is used to compute node memberships

type

Character. Type of measurement invariance to estimate. Only includes "loadings" at the moment

iter

Numeric. Number of iterations to perform for the permutation. Defaults to 500

ncores

Numeric. Number of cores to use in computing results. Defaults to parallel::detectCores() / 2 or half of your computer's processing power. Set to 1 to not use parallel computing

If you're unsure how many cores your computer has, then use the following code: parallel::detectCores()

...

Arguments passed to EGA

Author

Laura Jamison <lj5yn@virginia.edu>, Alexander P. Christensen <alexpaulchristensen@gmail.com>, and Hudson F. Golino <hfg9s at virginia.edu>

Examples

Run this code
# Load data
wmt <- wmt2[-1,7:24]

# Groups
groups <- rep(1:2, each = nrow(wmt) / 2)

# Fast for CRAN
# Measurement invariance
results <- invariance(wmt, groups, iter = 1, memberships = ega.wmt$wc, ncores = 2)


# \donttest{
# Measurement invariance
results <- invariance(wmt, groups, ncores = 2)
# }

Run the code above in your browser using DataLab