Learn R Programming

psychonetrics (version 0.7)

runmodel: Run a psychonetrics model

Description

This is the main function used to run a psychonetrics model.

Usage

runmodel(x, level = c("gradient", "fitfunction"), addfit =
                    TRUE, addMIs = TRUE, addSEs = TRUE, addInformation =
                    TRUE, log = TRUE, verbose, optim.control = list(),
                    analyticFisher = TRUE)

Arguments

x

A psychonetrics model.

level

Level at which the model should be estimated. Defaults to "gradient" to indicate the analytic gradient should be used.

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 optimr

analyticFisher

Logical, should the analytic Fisher information be used? If FALSE, numeric information is used instead.

Value

An object of the class psychonetrics (psychonetrics-class)

Examples

Run this code
# NOT RUN {
# 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
# }

Run the code above in your browser using DataLab