R/summary.regsem.R

Defines functions summary.regsem

Documented in summary.regsem

#' Summary results from regsem.
#'
#' @param object An object from regsem.
#' @param ... Other arguments.
#' @method summary regsem
#' @export


summary.regsem <- function(object,...){
  fits = fit_indices(object,CV=FALSE)

  if(any(is.null(object$mediation))==FALSE){
    TAB <- cbind(convergence = object$convergence,
                 df = object$df,
                 fit=object$fit,
                 rmsea = fits$fit["rmsea"],
                 BIC = fits$fit["BIC"])

    ret <- list(call=object$call,
                estimates = object$coefficients,
                returnVals=TAB,
                mediation=object$mediation)
  }else{
    TAB <- cbind(convergence = object$convergence,
                 df = object$df,
                 fit=object$fit,
                 rmsea = fits$fit["rmsea"],
                 BIC = fits$fit["BIC"])

    ret <- list(call=object$call,
                estimates = object$coefficients,
                returnVals=TAB)
  }



  class(ret) <- "summary.regsem"
  print(ret)
}

Try the regsem package in your browser

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

regsem documentation built on Dec. 6, 2017, 9:04 a.m.