View source: R/f_convenience_MIs.R
MIs | R Documentation |
This function prints a list of modification indices (MIs)
MIs(x, all = FALSE, matrices, type = c("normal", "equal", "free"), top = 10,
verbose = TRUE, nonZero = FALSE)
x |
A |
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. ( |
top |
Number of MIs to include in output if |
verbose |
Logical, should messages be printed? |
nonZero |
Logical, should only MIs be printed of non-zero parameters? Useful to explore violations of group equality. |
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.
Sacha Epskamp
# 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 = "zero")
# Run model:
mod <- mod %>% runmodel
# Modification indices:
mod %>% MIs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.