Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies cross models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.

# S3 method for factanal
tidy(x, ...)

Arguments

x

A factanal object created by stats::factanal().

...

Additional arguments. Not used. Needed to match generic signature only. Cautionary note: Misspelled arguments will be absorbed in ..., where they will be ignored. If the misspelled argument has a default value, the default value will be used. For example, if you pass conf.lvel = 0.9, all computation will proceed using conf.level = 0.95. Additionally, if you pass newdata = my_tibble to an augment() method that does not accept a newdata argument, it will use the default value for the data argument.

See also

Value

A tibble::tibble() with columns:

flX

Factor loading of term on factor X. There will be as many columns of this format as there were factors fitted.

variable

Needs custom info.

uniqueness

Proportion of residual, or unexplained variance

Examples

mod <- factanal(mtcars, 3, scores = "regression") glance(mod)
#> # A tibble: 1 x 8 #> n.factors total.variance statistic p.value df n method converged #> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <chr> <lgl> #> 1 3 0.862 30.5 0.205 25 32 mle TRUE
tidy(mod)
#> # A tibble: 11 x 5 #> variable uniqueness fl1 fl2 fl3 #> * <chr> <dbl> <dbl> <dbl> <dbl> #> 1 mpg 0.135 0.643 -0.478 -0.473 #> 2 cyl 0.0555 -0.618 0.703 0.261 #> 3 disp 0.0898 -0.719 0.537 0.323 #> 4 hp 0.127 -0.291 0.725 0.513 #> 5 drat 0.290 0.804 -0.241 -0.0684 #> 6 wt 0.0596 -0.778 0.248 0.524 #> 7 qsec 0.0515 -0.177 -0.946 -0.151 #> 8 vs 0.223 0.295 -0.805 -0.204 #> 9 am 0.208 0.880 0.0884 -0.0927 #> 10 gear 0.125 0.908 0.0211 0.224 #> 11 carb 0.158 0.114 0.559 0.719
augment(mod)
#> # A tibble: 32 x 4 #> .rownames .fs1 .fs2 .fs3 #> * <fct> <dbl> <dbl> <dbl> #> 1 Mazda RX4 0.847 0.672 -0.278 #> 2 Mazda RX4 Wag 0.722 0.384 0.0246 #> 3 Datsun 710 0.686 -0.592 -0.564 #> 4 Hornet 4 Drive -0.866 -0.673 -0.767 #> 5 Hornet Sportabout -0.893 0.862 -1.01 #> 6 Valiant -1.06 -1.07 -0.383 #> 7 Duster 360 -0.559 1.24 -0.199 #> 8 Merc 240D 0.0774 -1.50 0.409 #> 9 Merc 230 -0.242 -2.61 1.23 #> 10 Merc 280 0.183 -0.591 0.910 #> # ... with 22 more rows
augment(mod, mtcars)
#> Warning: Column `.rownames` joining factor and character vector, coercing into character vector
#> # A tibble: 32 x 15 #> .rownames mpg cyl disp hp drat wt qsec vs am gear carb #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 Mazda RX4 21 6 160 110 3.9 2.62 16.5 0 1 4 4 #> 2 Mazda RX… 21 6 160 110 3.9 2.88 17.0 0 1 4 4 #> 3 Datsun 7… 22.8 4 108 93 3.85 2.32 18.6 1 1 4 1 #> 4 Hornet 4… 21.4 6 258 110 3.08 3.22 19.4 1 0 3 1 #> 5 Hornet S… 18.7 8 360 175 3.15 3.44 17.0 0 0 3 2 #> 6 Valiant 18.1 6 225 105 2.76 3.46 20.2 1 0 3 1 #> 7 Duster 3… 14.3 8 360 245 3.21 3.57 15.8 0 0 3 4 #> 8 Merc 240D 24.4 4 147. 62 3.69 3.19 20 1 0 4 2 #> 9 Merc 230 22.8 4 141. 95 3.92 3.15 22.9 1 0 4 2 #> 10 Merc 280 19.2 6 168. 123 3.92 3.44 18.3 1 0 4 4 #> # ... with 22 more rows, and 3 more variables: .fs1 <dbl>, .fs2 <dbl>, #> # .fs3 <dbl>