This function automatically peforms step-up search by adding the parameter with the largest modification index until some criterion is reached or no modification indices are significant at alpha.
criterion: String indicating the criterion to minimize. Any criterion from fit can be used.
matrices: Vector of strings indicating which matrices should be searched. Will default to network structures and factor loadings.
mi: String indicating which kind of modification index should be used ("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).
greedyadjust: String indicating which p-value adjustment should be used in greedy start. Any method from p.adjust can be used.
stopif: An R expression, using objects from fit, which will break stepup search if it evaluates to TRUE. For example, stopif = rmsea < 0.05 will lead to search to stop if rmsea is below 0.05.
greedy: Logical, should a greedy start be used? If TRUE, the first step adds any parameter that is significant (after adjustement)
verbose: Logical, should messages be printed?
checkinformation: Logical, should the Fisher information be checked for potentially non-identified models?
singularinformation: String indicating how to proceed if the information matrix is singular. "tryfix"
will adjust starting values to try to fix the proble, "skip" will lead to the algorithm to skip the current parameter, "continue" will ignore the situation, and "stop"
will break the algorithm and return a list with the last two models.
startEPC: Logical, should the starting value be set at the expected parameter change?
...: Arguments sent to runmodel
Returns
An object of the class psychonetrics (psychonetrics-class )
Author(s)
Sacha Epskamp
See Also
prune
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 ="full")# Run model:mod <- mod %>%runmodel %>%prune(alpha =0.05)# Remove an edge (example):mod <- mod %>%fixpar("omega",1,2)%>%runmodel
# Stepup searchmod <- mod %>%stepup(alpha =0.05)