R/misc.R

Defines functions AIC3 AIC.randomLCA logLik.randomLCA

Documented in AIC3 AIC.randomLCA logLik.randomLCA

logLik.randomLCA <- function(object, ...)
{
     val <- object$logLik
    attr(val, "df") <- object$np
    attr(val, "nobs") <- object$nobs
    class(val) <- "logLik"
    val
}

BIC.randomLCA <-
function (object, ...) 
{
    if (!is.element("randomLCA", class(object))) 
        stop("Argument 'object' must be an object of class \"randomLCA\".")
    BIC(logLik(object))
}

AIC.randomLCA <-
function(object,...,k=2) {
    if (!inherits(object, "randomLCA"))
        stop("Use only with 'randomLCA' objects.\n")
    AIC(logLik(object),...,k)
}

AIC3 <-
  function(object) {
    if (!inherits(object, "randomLCA"))
      stop("Use only with 'randomLCA' objects.\n")
    AIC(logLik(object),k=3)
  }

Try the randomLCA package in your browser

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

randomLCA documentation built on July 9, 2023, 6:09 p.m.