% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.efa.R
\name{print.efa}
\alias{print.efa}
\alias{print.efa_mi}
\alias{format.efa}
\alias{format.efa_mi}
\alias{summary.efa}
\alias{summary.efa_mi}
\alias{print.summary.efa}
\alias{format.summary.efa}
\title{Print and summarise an efa object}
\usage{
\method{print}{efa}(x, ...)

\method{print}{efa_mi}(x, ...)

\method{format}{efa}(
  x,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  sort_loadings = c("none", "primary", "clustered"),
  show_loading_legend = TRUE,
  max_factors_per_block = NULL,
  ...
)

\method{format}{efa_mi}(x, ...)

\method{summary}{efa}(
  object,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  ci = c("auto", "none", "separate"),
  ci_filter = c("salient", "all", "nonzero"),
  diagnostics_top_n = 10,
  residual_cutoff = 0.1,
  residual_top_n = 10,
  show_structure = TRUE,
  sort_loadings = c("none", "primary", "clustered"),
  show_loading_legend = TRUE,
  cross_loading_cutoff = cutoff,
  min_primary_gap = 0.2,
  min_salient_per_factor = 3,
  max_factors_per_block = NULL,
  show_mi_diagnostics = NULL,
  ...
)

\method{summary}{efa_mi}(object, ...)

\method{print}{summary.efa}(x, ...)

\method{format}{summary.efa}(x, ...)
}
\arguments{
\item{x, object}{An object of class \code{efa} (from \code{\link[=efa_fit]{efa_fit()}}) or \code{efa_mi} (from \code{\link[=efa_mi]{efa_mi()}}); for
the \code{summary.efa} methods, the object returned by \code{summary()}.}

\item{...}{Further arguments passed to \code{\link[=print.efa_loadings]{print.efa_loadings()}}.}

\item{cutoff}{numeric. The absolute value at or above which loadings are
emphasised in the loading table. Default is .3.}

\item{digits}{numeric. Number of decimal places for the printed tables.
Default is 3.}

\item{max_name_length}{numeric. Maximum length of the variable names to
display; longer names are cut from the right, or abbreviated where cutting
would give two variables the same label. Applies to every table that names
variables. \code{name_style} (see \code{\link[=print.efa_loadings]{print.efa_loadings()}}) can be passed through
\code{...} to choose the shortening explicitly, but it reaches the loading table
only; the confidence-interval and simple-structure tables always shorten by
cutting.}

\item{sort_loadings}{character. Optional row sorting for the loading table.
See \code{\link[=print.efa_loadings]{print.efa_loadings()}}.}

\item{show_loading_legend}{logical. Whether to print a short legend for the
loading-table styling. Default is \code{TRUE}. The legend is only printed when
that styling is actually rendered (a colour-capable console); in plain
output it is omitted and this argument has no effect.}

\item{max_factors_per_block}{numeric or \code{NULL}. Maximum number of factor
columns per loading-table block. If \code{NULL}, chosen from the console width.}

\item{ci}{character. Which confidence intervals \code{summary()} shows, if
available. \code{"auto"} and \code{"separate"} print CI sections when CIs were
computed; \code{"none"} suppresses them. Default is \code{"auto"}.}

\item{ci_filter}{character. Which loading CIs \code{summary()} prints: \code{"salient"}
(default), \code{"all"}, or \code{"nonzero"}; see Details.}

\item{diagnostics_top_n}{numeric. Maximum number of item-level entries
\code{summary()} prints per simple-structure diagnostic.}

\item{residual_cutoff}{numeric. Absolute residual cutoff for the residual
diagnostics in \code{summary()}. Default is .1.}

\item{residual_top_n}{numeric. Maximum number of residuals \code{summary()} prints.
Use \code{Inf} to print all residuals above \code{residual_cutoff}.}

\item{show_structure}{logical. Whether \code{summary()} prints the structure matrix
for oblique solutions when available. Default is \code{TRUE}.}

\item{cross_loading_cutoff}{numeric. Cutoff for counting cross-loadings in the
\code{summary()} diagnostics. Defaults to \code{cutoff}.}

\item{min_primary_gap}{numeric. Minimum desired absolute difference between the
largest and second-largest absolute loading of an item, used in the
\code{summary()} diagnostics.}

\item{min_salient_per_factor}{numeric. Minimum number of salient indicators per
factor used in the \code{summary()} diagnostics. Default is 3.}

\item{show_mi_diagnostics}{logical or \code{NULL}. Whether \code{summary()} prints a
multiple-imputation uncertainty summary for pooled EFAs. \code{NULL} shows it for
pooled objects.}
}
\value{
\code{print()} and the print method for \code{summary.efa} objects return their
argument invisibly. \code{format()} returns a character vector with the report
lines. \code{summary()} returns an object of class \code{summary.efa}.
}
\description{
\code{print()} shows a concise overview of an \code{\link[=efa_fit]{efa_fit()}} or \code{\link[=efa_mi]{efa_mi()}} solution:
a model header, the loading matrix (with the factor intercorrelations for
oblique solutions), the variances accounted for, and the model fit.
\code{summary()} returns a \code{summary.efa} object whose print method adds the full
diagnostics: model and simple-structure diagnostics, confidence-interval
tables, the structure matrix, multiple-imputation uncertainty (for pooled
objects), and residual diagnostics. \code{format()} assembles the same report and
returns it as a character vector; \code{print()} is \code{cat(format(x), sep = "\\n")}.
The lines follow the active console theme, so they are plain when colours are
disabled (for example when captured into a file or stripped with
\code{\link[cli:ansi_strip]{cli::ansi_strip()}}).
}
\details{
The methods are shared by single-imputation \code{efa} objects and pooled
\code{efa_mi} objects. For \code{efa_mi} objects the header reports the number
of imputations and the alignment/pooling settings; confidence intervals and a
multiple-imputation uncertainty summary are shown by \code{summary()} when the
pooled object carries bootstrap/MI quantities.

In \code{summary()}, \code{ci_filter} controls which loading intervals are shown:
\code{"salient"} reports intervals for loadings whose absolute point estimate is at
least \code{cutoff}, \code{"nonzero"} reports intervals excluding zero, and \code{"all"}
reports every finite interval.
}
\examples{
mod <- efa_fit(test_models$baseline$cormat, n_factors = 3, N = 500,
               estimator = "PAF", rotation = "promax")
mod

# The full diagnostics, CI tables, and residual diagnostics:
summary(mod)

# format() returns the same lines as a character vector, e.g. for a report file:
writeLines(format(mod))

}
