fit_stats: Compute fit statistics.

View source: R/model_misc.R

fit_statsR Documentation

Compute fit statistics.

Description

This function assemble the model parameters and fit statistics into a table. It also compares nested models.

Usage

fit_stats(model, nested_models = NULL)

Arguments

model

MxModel with the reference models included.

nested_models

the list of nested models (MxModels) to be compared against the target model.

Value

data.frame

Note

The function uses summary.MxModel and mxCompare to assembe the following parameters and statistics:

  • ep~— number of estimated parameters;

  • minus2LL~— -2*log-likelihood;

  • df~— degrees of freedom;

  • AIC~— Akaike Information Criterion;

  • BIC~— Bayesian Information Criterion;

  • CFI~— Comparative Fit Index;

  • TLI~— Tucker-Lewis Index;

  • RMSEA~— Root Mean Square Error of Approximation;

  • diffLL~— log-likelihood difference between two models, chi-squared;

  • diffdf~— the difference in degrees of freedom between two models, chi-square df;

  • p~— p-value of the chi-square test.

The references will be added.

The nested models are compared against the target model by means of the chi-square test (the same way the target model is compared against the saturated model).

This function does not perform any computation, it is a wrapper for the OpenMx functions aiming to simplify the preparation of the output from SEM.


IvanVoronin/TwinAnalysis documentation built on June 14, 2025, 11:05 p.m.