View source: R/stats-factanal.R
glance.factanal | R Documentation |
Glance accepts a model object and returns a tibble::tibble()
with exactly one row of model summaries. The summaries are typically
goodness of fit measures, p-values for hypothesis tests on residuals,
or model convergence information.
Glance never returns information from the original call to the modeling function. This includes the name of the modeling function or any arguments passed to the modeling function.
Glance does not calculate summary measures. Rather, it farms out these
computations to appropriate methods and gathers the results together.
Sometimes a goodness of fit measure will be undefined. In these cases
the measure will be reported as NA
.
Glance returns the same number of columns regardless of whether the
model matrix is rank-deficient or not. If so, entries in columns
that no longer have a well-defined value are filled in with an NA
of the appropriate type.
## S3 method for class 'factanal'
glance(x, ...)
x |
A |
... |
Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in
|
A tibble::tibble()
with exactly one row and columns:
converged |
Logical indicating if the model fitting procedure was succesful and converged. |
df |
Degrees of freedom used by the model. |
method |
Which method was used. |
n |
The total number of observations. |
n.factors |
The number of fitted factors. |
nobs |
Number of observations used. |
p.value |
P-value corresponding to the test statistic. |
statistic |
Test statistic. |
total.variance |
Total cumulative proportion of variance accounted for by all factors. |
glance()
, stats::factanal()
Other factanal tidiers:
augment.factanal()
,
tidy.factanal()
set.seed(123)
# generate data
library(dplyr)
library(purrr)
m1 <- tibble(
v1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 4, 5, 6),
v2 = c(1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 4, 3, 3, 3, 4, 6, 5),
v3 = c(3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 6),
v4 = c(3, 3, 4, 3, 3, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 5, 6, 4),
v5 = c(1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 6, 4, 5),
v6 = c(1, 1, 1, 2, 1, 3, 3, 3, 4, 3, 1, 1, 1, 2, 1, 6, 5, 4)
)
# new data
m2 <- map_dfr(m1, rev)
# factor analysis objects
fit1 <- factanal(m1, factors = 3, scores = "Bartlett")
fit2 <- factanal(m1, factors = 3, scores = "regression")
# tidying the object
tidy(fit1)
tidy(fit2)
# augmented dataframe
augment(fit1)
augment(fit2)
# augmented dataframe (with new data)
augment(fit1, data = m2)
augment(fit2, data = m2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.