step1: Estimating state-specific measurement models

View source: R/7Step1.R

step1R Documentation

Estimating state-specific measurement models

Description

step1 conducts step 1 of the three-step estimation of LMFA and thus the estimation of the measurement models. It is possible to estimate the parameters for a single model or for a range of models and to conduct model selection.

Usage

step1(
  data,
  indicators,
  n_state = NULL,
  n_fact = NULL,
  modelselection = FALSE,
  n_state_range = NULL,
  n_fact_range = NULL,
  n_starts = 25,
  n_initial_ite = 15,
  n_m_step = 10,
  em_tolerance = 1e-08,
  m_step_tolerance = 0.001,
  max_iterations = 1000,
  n_mclust = 5
)

Arguments

data

The dataset (must be a dataframe and contain complete cases only).

indicators

The variable names of the indicators (must be a vector of characters).

n_state

The number of states that should be estimated (must be a single scalar).

n_fact

The number of factors per state that should be estimated (must be a numeric vector of length n_state).

modelselection

Indicates whether model selection should be performed or not. If TRUE, the arguments n_state_range and n_fact_range are required (must be a logical statement).

n_state_range

A vector indicating the number of states that should be considered in the model selection.

n_fact_range

A vector indicating the number of factors that should be considered in the model selection.

n_starts

The number of random starts that should be used (must be a single scalar).

n_initial_ite

The number of initial iterations for the best starts (must be a single scalar).

n_m_step

The number of M-step iterations that should be used when parameters still change more than defined by the m_step_tolerance (must be a single scalar).

em_tolerance

The convergence criterion for parameters and loglikelihood (must be a single scalar and smaller than m_step_tolerance).

m_step_tolerance

The criterion for stopping the n_m_step M-step iterations (must be a single scalar).

max_iterations

The maximum number of iterations (must be a single scalar and larger than n_initial_ite).

n_mclust

The number of mclust starts (must be a single scalar and at least equal to 2).

Value

Returns the state-specific measurement model parameters and model fit information (for one or multiple estimated model).

Examples

## Not run: 
step1_results <- step1(data,
                 indicators,
                 n_state = NULL,
                 n_fact = NULL, 
                 modelselection = FALSE, 
                 n_state_range = NULL, 
                 n_fact_range = NULL,
                 n_starts = 25,
                 n_initial_ite = 15,
                 n_m_step = 10,
                 em_tolerance = 1e-8, 
                 m_step_tolerance = 1e-3, 
                 max_iterations = 1000,
                 n_mclust = 5
                 )

## End(Not run)

LeonieVm/lmfa documentation built on Dec. 5, 2023, 1:38 p.m.