Learn R Programming

LCPA (version 1.0.1)

get.fit.index: Calculate Fit Indices

Description

Computes a comprehensive set of model fit indices for objects returned by LCA or LPA. These indices balance model fit (log-likelihood) with model complexity (number of parameters) to facilitate model selection. All indices are derived from the observed-data log-likelihood and parameter count.

Usage

get.fit.index(object)

Value

An object of class "fit.index" containing:

npar

Number of free parameters in the model

Log.Lik

Log-likelihood of the model: \(\log \mathcal{L}\)

-2LL

Deviance statistic: \(-2 \log \mathcal{L}\) $$-2 \sum_{n=1}^N \log \left[ \sum_{l=1}^L \pi_l \cdot f(\mathbf{x}_n \mid \boldsymbol{\theta}_l) \right]$$, where \(\pi_l\) is the prior probability of class \(l\), \(f(\cdot)\) is the probability density/mass function (multivariate normal for LPA, multinomial for LCA), and \(\boldsymbol{\theta}_l\) are class-specific parameters.

AIC

Akaike Information Criterion: \(\mathrm{AIC} = -2 \log \mathcal{L} + 2k\), where \(npar\) = number of free parameters. Lower values indicate better fit.

BIC

Bayesian Information Criterion: \(\mathrm{BIC} = -2 \log \mathcal{L} + npar \log(N)\), where \(N\) = sample size. Incorporates stronger penalty for complexity than AIC.

SIC

Sample-Size Adjusted BIC: \(\mathrm{SIC} = -\frac{1}{2} \mathrm{BIC}\). Equivalent to \(\log \mathcal{L} - \frac{npar}{2} \log(N)\). Often used in latent class modeling.

CAIC

Consistent AIC: \(\mathrm{CAIC} = -2 \log \mathcal{L} + npar \left[ \log(N) + 1 \right]\). Consistent version of AIC that converges to true model as \(N \to \infty\).

AWE

Approximate Weight of Evidence: \(\mathrm{AWE} = -2 \log \mathcal{L} + 1.5k \left[ \log(N) + 1 \right]\). Penalizes complexity more heavily than CAIC.

SABIC

Sample-Size Adjusted BIC: \(\mathrm{SABIC} = -2 \log \mathcal{L} + npar \log \left( \frac{N + 2}{24} \right)\). Recommended for latent class/profile analysis with moderate sample sizes.

Arguments

object

An object of class "LCA" or "LPA" returned by LCA, LPA or any object containing:

  • Log.Lik: Log-likelihood value

  • npar: Number of free parameters

  • \(N\) = Total number of observations (\(n = 1, 2, \dots, N\))

Examples

Run this code
# \donttest{
# Fit LPA model
set.seed(123)
data.obj <- sim.LPA(N = 100, I = 3, L = 2, constraint = "E0")
fit <- LPA(data.obj$response, L = 2, constraint = "VV", method = "EM")

# Compute fit indices
fit_indices <- get.fit.index(fit)

fit_indices

extract(fit_indices, "SABIC")
# }

Run the code above in your browser using DataLab