runmodel | R Documentation |
This is the main function used to run a psychonetrics model.
runmodel(x, level = c("gradient", "fitfunction"), addfit =
TRUE, addMIs = TRUE, addSEs = TRUE, addInformation =
TRUE, log = TRUE, verbose, optim.control,
analyticFisher = TRUE, warn_improper = FALSE,
warn_gradient = TRUE, warn_bounds = TRUE,
return_improper = TRUE, bounded = TRUE,
approximate_SEs = FALSE)
x |
A |
level |
Level at which the model should be estimated. Defaults to |
addfit |
Logical, should fit measures be added? |
addMIs |
Logical, should modification indices be added? |
addSEs |
Logical, should standard errors be added? |
addInformation |
Logical, should the Fisher information be added? |
log |
Logical, should the log be updated? |
verbose |
Logical, should messages be printed? |
optim.control |
A list with options for |
analyticFisher |
Logical, should the analytic Fisher information be used? If |
return_improper |
Should a result in which improper computation was used be return? Improper computation can mean that a pseudoinverse of small spectral shift was used in computing the inverse of a matrix. |
warn_improper |
Logical. Should a warning be given when at some point in the estimation a pseudoinverse was used? |
warn_gradient |
Logical. Should a warning be given when the average absolute gradient is > 1? |
bounded |
Logical. Should bounded estimation be used (e.g., variances should be positive)? |
approximate_SEs |
Logical, should standard errors be approximated? If true, an approximate matrix inverse of the Fischer information is used to obtain the standard errors. |
warn_bounds |
Should a warning be given when a parameter is estimated near its bounds? |
An object of the class psychonetrics (psychonetrics-class)
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 = "full")
# Run model:
mod <- mod %>% runmodel
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.