MIs: Print modification indices

View source: R/f_convenience_MIs.R

MIsR Documentation

Print modification indices

Description

This function prints a list of modification indices (MIs)

Usage

MIs(x, all = FALSE, matrices, type = c("normal", "equal", "free"), top = 10, 
    verbose = TRUE, nonZero = FALSE)

Arguments

x

A psychonetrics model.

all

Logical, should all MIs be printed or only the highest?

matrices

Optional vector of matrices to include in the output.

type

String indicating which kind of modification index should be printed. ("mi" is the typical MI, "mi_free" is the modification index free from equality constrains across groups, and "mi_equal" is the modification index if the parameter is added constrained equal across all groups).

top

Number of MIs to include in output if all = FALSE

verbose

Logical, should messages be printed?

nonZero

Logical, should only MIs be printed of non-zero parameters? Useful to explore violations of group equality.

Value

Invisibly returns a relevant subset of the data frame containing all information on the parameters, or a list of such data frames if multiple types of MIs are requested.

Author(s)

Sacha Epskamp

Examples

# Load bfi data from psych package:
library("psychTools")
data(bfi)

# Also load dplyr for the pipe operator:
library("dplyr")

# Let's take the agreeableness items, and gender:
ConsData <- bfi %>% 
  select(A1:A5, gender) %>% 
  na.omit # Let's remove missingness (otherwise use Estimator = "FIML)

# Define variables:
vars <- names(ConsData)[1:5]

# Let's fit a full GGM:
mod <- ggm(ConsData, vars = vars, omega = "empty")

# Run model:
mod <- mod %>% runmodel

# Modification indices:
mod %>% MIs

psychonetrics documentation built on Oct. 3, 2023, 5:09 p.m.