Get Started

Calculating eigenvalues

To empirically determine the dimensionality of your data, a common strategy is to examine the eigenvalues. Eigenvalues are numeric representations of the amount of variance explained by each factor or component. Eigenvalues are calculated from a correlation matrix, so you'll need to use cor() to calculate and store the dataset's correlation matrix before calculating eigenvalues. You'll need to specify that you want to use pairwise complete observations. The default is to use everything, but if your dataset has any missing values, this will leave you with a matrix full of NAs.

You'll do these calculations on the bfi_EFA dataset you just created - remember, you're saving the data in bfi_CFA for your confirmatory analysis!

This is a part of the course

“Factor Analysis in R”

View Course

Exercise instructions

  • Use cor() to calculate the correlation matrix for your EFA dataset. Set the value of the use argument to use pairwise-complete observations.
  • Next, use that correlation matrix with the eigen() function to get eigenvalues.
  • The eigenvalues are stored in the values element of the eigenvals list object. Take a look!

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Calculate the correlation matrix first
bfi_EFA_cor <- ___(bfi_EFA, use = ___)

# Then use that correlation matrix to calculate eigenvalues
eigenvals <- ___(bfi_EFA_cor)

# Look at the eigenvalues returned
___$___
Edit and Run Code