stepup | R Documentation |
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.
stepup(x, alpha = 0.01, criterion = "bic", matrices, mi =
c("mi", "mi_free", "mi_equal"), greedyadjust =
c("bonferroni", "none", "holm", "hochberg", "hommel",
"fdr", "BH", "BY"), stopif, greedy = FALSE, verbose,
checkinformation = TRUE, singularinformation =
c("tryfix", "skip", "continue", "stop"), startEPC =
TRUE, ...)
x |
A |
alpha |
Significance level to use. |
criterion |
String indicating the criterion to minimize. Any criterion from |
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 ( |
greedyadjust |
String indicating which p-value adjustment should be used in greedy start. Any method from |
stopif |
An R expression, using objects from |
greedy |
Logical, should a greedy start be used? If |
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. |
startEPC |
Logical, should the starting value be set at the expected parameter change? |
... |
Arguments sent to |
An object of the class psychonetrics (psychonetrics-class)
Sacha Epskamp
prune
# 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 search
mod <- mod %>%stepup(alpha = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.