Debian Codegraph @

man/tidy.factanal.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/stats-factanal.R
3 \name{tidy.factanal}
4 \alias{tidy.factanal}
5 \alias{factanal_tidiers}
6 \title{Tidy a(n) factanal object}
7 \usage{
8 \method{tidy}{factanal}(x, ...)
9 }
10 \arguments{
11 \item{x}{A \code{factanal} object created by \code{\link[stats:factanal]{stats::factanal()}}.}
12
13 \item{...}{Additional arguments. Not used. Needed to match generic
14 signature only. \strong{Cautionary note:} Misspelled arguments will be
15 absorbed in \code{...}, where they will be ignored. If the misspelled
16 argument has a default value, the default value will be used.
17 For example, if you pass \code{conf.lvel = 0.9}, all computation will
18 proceed using \code{conf.level = 0.95}. Two exceptions here are:
19 \itemize{
20 \item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if
21 it will be ignored.
22 \item \code{augment()} methods will warn when supplied a \code{newdata} argument if it
23 will be ignored.
24 }}
25 }
26 \description{
27 Tidy summarizes information about the components of a model.
28 A model component might be a single term in a regression, a single
29 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
30 model component varies across models but is usually self-evident.
31 If a model has several distinct types of components, you will need to
32 specify which components to return.
33 }
34 \examples{
35
36 set.seed(123)
37
38 # generate data
39 library(dplyr)
40 library(purrr)
41
42 m1 <- tibble(
43 v1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 4, 5, 6),
44 v2 = c(1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 4, 3, 3, 3, 4, 6, 5),
45 v3 = c(3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 6),
46 v4 = c(3, 3, 4, 3, 3, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 5, 6, 4),
47 v5 = c(1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 6, 4, 5),
48 v6 = c(1, 1, 1, 2, 1, 3, 3, 3, 4, 3, 1, 1, 1, 2, 1, 6, 5, 4)
49 )
50
51 # new data
52 m2 <- map_dfr(m1, rev)
53
54 # factor analysis objects
55 fit1 <- factanal(m1, factors = 3, scores = "Bartlett")
56 fit2 <- factanal(m1, factors = 3, scores = "regression")
57
58 # tidying the object
59 tidy(fit1)
60 tidy(fit2)
61
62 # augmented dataframe
63 augment(fit1)
64 augment(fit2)
65
66 # augmented dataframe (with new data)
67 augment(fit1, data = m2)
68 augment(fit2, data = m2)
69
70 }
71 \seealso{
72 \code{\link[=tidy]{tidy()}}, \code{\link[stats:factanal]{stats::factanal()}}
73
74 Other factanal tidiers:
75 \code{\link{augment.factanal}()},
76 \code{\link{glance.factanal}()}
77 }
78 \concept{factanal tidiers}
79 \value{
80 A \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
81 \item{variable}{Variable under consideration.}
82 \item{uniqueness}{Proportion of residual, or unexplained variance}
83 \item{flX}{Factor loading for level X.}
84
85 }