| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/stats-factanal.R |
| 3 |
\name{glance.factanal} |
| 4 |
\alias{glance.factanal} |
| 5 |
\title{Glance at a(n) factanal object} |
| 6 |
\usage{ |
| 7 |
\method{glance}{factanal}(x, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{A \code{factanal} object created by \code{\link[stats:factanal]{stats::factanal()}}.} |
| 11 |
|
| 12 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 13 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 14 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 15 |
argument has a default value, the default value will be used. |
| 16 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 17 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 18 |
\itemize{ |
| 19 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 20 |
it will be ignored. |
| 21 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 22 |
will be ignored. |
| 23 |
}} |
| 24 |
} |
| 25 |
\description{ |
| 26 |
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}} |
| 27 |
with exactly one row of model summaries. The summaries are typically |
| 28 |
goodness of fit measures, p-values for hypothesis tests on residuals, |
| 29 |
or model convergence information. |
| 30 |
|
| 31 |
Glance never returns information from the original call to the modeling |
| 32 |
function. This includes the name of the modeling function or any |
| 33 |
arguments passed to the modeling function. |
| 34 |
|
| 35 |
Glance does not calculate summary measures. Rather, it farms out these |
| 36 |
computations to appropriate methods and gathers the results together. |
| 37 |
Sometimes a goodness of fit measure will be undefined. In these cases |
| 38 |
the measure will be reported as \code{NA}. |
| 39 |
|
| 40 |
Glance returns the same number of columns regardless of whether the |
| 41 |
model matrix is rank-deficient or not. If so, entries in columns |
| 42 |
that no longer have a well-defined value are filled in with an \code{NA} |
| 43 |
of the appropriate type. |
| 44 |
} |
| 45 |
\examples{ |
| 46 |
|
| 47 |
set.seed(123) |
| 48 |
|
| 49 |
# generate data |
| 50 |
library(dplyr) |
| 51 |
library(purrr) |
| 52 |
|
| 53 |
m1 <- tibble( |
| 54 |
v1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 4, 5, 6), |
| 55 |
v2 = c(1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 4, 3, 3, 3, 4, 6, 5), |
| 56 |
v3 = c(3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 6), |
| 57 |
v4 = c(3, 3, 4, 3, 3, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 5, 6, 4), |
| 58 |
v5 = c(1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 6, 4, 5), |
| 59 |
v6 = c(1, 1, 1, 2, 1, 3, 3, 3, 4, 3, 1, 1, 1, 2, 1, 6, 5, 4) |
| 60 |
) |
| 61 |
|
| 62 |
# new data |
| 63 |
m2 <- map_dfr(m1, rev) |
| 64 |
|
| 65 |
# factor analysis objects |
| 66 |
fit1 <- factanal(m1, factors = 3, scores = "Bartlett") |
| 67 |
fit2 <- factanal(m1, factors = 3, scores = "regression") |
| 68 |
|
| 69 |
# tidying the object |
| 70 |
tidy(fit1) |
| 71 |
tidy(fit2) |
| 72 |
|
| 73 |
# augmented dataframe |
| 74 |
augment(fit1) |
| 75 |
augment(fit2) |
| 76 |
|
| 77 |
# augmented dataframe (with new data) |
| 78 |
augment(fit1, data = m2) |
| 79 |
augment(fit2, data = m2) |
| 80 |
|
| 81 |
} |
| 82 |
\seealso{ |
| 83 |
\code{\link[=glance]{glance()}}, \code{\link[stats:factanal]{stats::factanal()}} |
| 84 |
|
| 85 |
Other factanal tidiers: |
| 86 |
\code{\link{augment.factanal}()}, |
| 87 |
\code{\link{tidy.factanal}()} |
| 88 |
} |
| 89 |
\concept{factanal tidiers} |
| 90 |
\value{ |
| 91 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns: |
| 92 |
\item{converged}{Logical indicating if the model fitting procedure was succesful and converged.} |
| 93 |
\item{df}{Degrees of freedom used by the model.} |
| 94 |
\item{method}{Which method was used.} |
| 95 |
\item{n}{The total number of observations.} |
| 96 |
\item{n.factors}{The number of fitted factors.} |
| 97 |
\item{nobs}{Number of observations used.} |
| 98 |
\item{p.value}{P-value corresponding to the test statistic.} |
| 99 |
\item{statistic}{Test statistic.} |
| 100 |
\item{total.variance}{Total cumulative proportion of variance accounted for by all factors.} |
| 101 |
|
| 102 |
} |