R/extract_fa_loads.R
extract_fa_loads.Rd
Function to create a loadings file from the factanal() output
extract_fa_loads(fa_object)
fa_output <- factanal(tidyr::drop_na(psych::bfi), factors = 6)
extract_fa_loads(fa_output)
#>
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#> Variable = col_character(),
#> Factor1 = col_double(),
#> Factor2 = col_double(),
#> Factor3 = col_double(),
#> Factor4 = col_double(),
#> Factor5 = col_double(),
#> Factor6 = col_double(),
#> loadings_max = col_character()
#> )
#> Variable Factor1 Factor2 Factor3 Factor4 Factor5
#> 1 A1 0.0711590149 -0.339951226 0.0669161832 -0.057568671 0.01275224
#> 2 A2 0.0519531898 0.605869311 0.1058123044 -0.101956033 0.02942592
#> 3 A3 0.0029036043 0.671608560 0.0958360380 -0.133477189 0.10337555
#> 4 A4 -0.0688209092 0.482036406 0.2137733287 -0.081336349 -0.09360168
#> 5 A5 -0.1488127713 0.623984721 0.0753613480 -0.182919732 0.14136974
#> 6 C1 -0.0006847579 0.064943444 0.5406391769 -0.005084823 0.22054557
#> 7 C2 0.0593314874 0.149095035 0.6481715754 0.077898168 0.14104300
#> 8 C3 -0.0374376731 0.128019764 0.5444598609 -0.002322279 0.00162228
#> 9 C4 0.1832830681 0.007863373 -0.6488041425 0.173179433 -0.01106893
#> 10 C5 0.2516459147 -0.084818958 -0.5579928015 0.215590736 0.04883687
#> 11 E1 -0.0041359563 -0.260308660 0.0547136782 0.557385722 -0.10412098
#> 12 E2 0.2104102671 -0.295158619 -0.0862208159 0.625601473 -0.12858140
#> 13 E3 -0.0132316840 0.426629205 0.0890809008 -0.341982404 0.41782921
#> 14 E4 -0.1440359012 0.532501531 0.0902679840 -0.469009582 0.06629820
#> 15 E5 0.0591000085 0.235081619 0.3022317000 -0.430115845 0.27338350
#> 16 N1 0.8134706727 -0.131758583 -0.0506763177 -0.092482546 -0.03911919
#> 17 N2 0.8125421672 -0.151019098 -0.0282003399 -0.082679961 -0.01139817
#> 18 N3 0.7054047305 0.016356396 -0.0639145377 0.128450387 0.02031393
#> 19 N4 0.5364909322 -0.067829901 -0.1762405906 0.412011930 0.06569517
#> 20 N5 0.5075943251 0.122126674 -0.0568461268 0.237674736 -0.14660485
#> 21 O1 -0.0399416282 0.079115632 0.1278887084 -0.091966747 0.56080011
#> 22 O2 0.1495753807 0.174849759 -0.1089290917 0.057611706 -0.40327844
#> 23 O3 0.0031438557 0.167023399 0.0705494463 -0.163875437 0.65569700
#> 24 O4 0.1920094956 0.050313668 -0.0405655509 0.270449225 0.33338589
#> 25 O5 0.0452679889 0.082722955 -0.0615476073 0.044603815 -0.46410224
#> 26 gender 0.1538844271 0.244555827 0.0705722614 -0.083996152 -0.18749836
#> 27 education -0.0254132934 -0.001292035 -0.0005026964 0.029150536 0.11030922
#> 28 age -0.0746619538 0.047945490 0.0616984955 -0.036541434 0.01672351
#> Factor6 loadings_max
#> 1 0.492574451 Factor6
#> 2 -0.295453121 Factor2
#> 3 -0.099440471 Factor2
#> 4 -0.030406968 Factor2
#> 5 0.005777041 Factor2
#> 6 0.009427028 Factor3
#> 7 0.074424301 Factor3
#> 8 -0.026113959 Factor3
#> 9 0.282739400 Factor6
#> 10 0.052368676 Factor1
#> 11 0.089479507 Factor4
#> 12 0.007971457 Factor4
#> 13 0.148449773 Factor2
#> 14 0.184849152 Factor2
#> 15 -0.016776015 Factor3
#> 16 0.121089554 Factor1
#> 17 0.023037901 Factor1
#> 18 0.096059068 Factor1
#> 19 0.037985740 Factor1
#> 20 0.093484052 Factor1
#> 21 0.008848701 Factor5
#> 22 0.266814482 Factor6
#> 23 -0.035899368 Factor5
#> 24 -0.113649349 Factor5
#> 25 0.344124951 Factor6
#> 26 -0.187131474 Factor2
#> 27 -0.200144740 Factor5
#> 28 -0.258983339 Factor3