R/lav_lavaan_step12_implied.R

Defines functions lav_lavaan_step12_loglik lav_lavaan_step12_implied

lav_lavaan_step12_implied <- function(lavoptions = NULL,
                                      lavmodel = NULL) {
  # # # # # # # # # # # #
  # #  12. lavimplied # #
  # # # # # # # # # # # #

  # if lavoptions$implied compute lavimplied via lav_model_implied
  lavimplied <- list()
  if (lavoptions$implied) {
    if (lav_verbose()) {
      cat("lavimplied  ...")
    }
    lavimplied <- lav_model_implied(lavmodel)
    if (lav_verbose()) {
      cat(" done.\n")
    }
  }

  lavimplied
}

lav_lavaan_step12_loglik <- function(lavoptions = NULL,
                                     lavdata = NULL,
                                     lavsamplestats = NULL,
                                     lavimplied = NULL,
                                     lavmodel = NULL) {
  # # # # # # # # # # # #
  # #  12. lavloglik  # #
  # # # # # # # # # # # #

  # if lavoptions$loglik compute lavloglik via lav_model_loglik
  lavloglik <- list()
  if (lavoptions$loglik) {
    if (lav_verbose()) {
      cat("lavloglik   ...")
    }
    lavloglik <- lav_model_loglik(
      lavdata = lavdata,
      lavsamplestats = lavsamplestats,
      lavimplied = lavimplied,
      lavmodel = lavmodel,
      lavoptions = lavoptions
    )
    if (lav_verbose()) {
      cat(" done.\n")
    }
  }

  lavloglik
}

Try the lavaan package in your browser

Any scripts or data that you put into this service are public.

lavaan documentation built on Sept. 27, 2024, 9:07 a.m.