tall.loadings: Tall/Long Factor Loading Matrices

View source: R/tall.loadings.R

tall.loadingsR Documentation

Tall/Long Factor Loading Matrices

Description

Factor loadings from factor analysis functions such as psych::fa() produce factor loading matrices in wide-format. Tall versions of factor loading matrices allow us to better inspect the items and factor loadings of each individual factor. This is a function created to automate the conversion to tall format, eliminating factor loadings below a certain threshold and sorting the output by factors or items.

Usage

tall.loadings(structure, cut = 0.2, dp = 2, sortby = "FACTOR")

Arguments

structure

A matrix/dataframe of factor loadings in wide-format.

cut

Defaults to 0.2. The minimum cut-off for factor loadings. Factor loadings below this value are removed.

dp

Defaults to 2. Number of decimal points for all numeric values.

sortby

Defaults to "FACTOR". Sorts the output by factors, change value to "ITEM" to sort by items.

Examples

library(psych)
myefa <- fa(Harman74.cor$cov, 4, fm = "wls")
tall.loadings(myefa$Structure)
tall.loadings(myefa$loadings)

Aaron0696/aaRon documentation built on July 27, 2023, 2:05 p.m.