Concept map / Factor analysis

Share

Factor analysis and item correlations

Change factor loadings and factor correlations to see the correlation matrix implied by the model.

1Six school tests and the factors behind them

Scores in vocabulary, reading, spelling, arithmetic, algebra and geometry tend to rise and fall together. A factor is an unobserved variable that accounts for that shared variation, and a loading is the coefficient that links a score to its factor.

Here each test loads on one factor, every variable is standardized, and the residuals are uncorrelated. Move the loadings and watch the correlation matrix the model implies. Then simulate people and see how closely a sample reproduces it.

Factors and loadingsShare of variance0.800.700.600.800.700.60F1 Vocab64% common2 Reading49% common3 Spelling36% common4 Arith64% common5 Algebra49% common6 Geometry36% commonCorrelations the model implies1 Vocab12 Reading23 Spelling34 Arith45 Algebra56 Geometry61Vocab with Reading: model 0.560.56Vocab with Spelling: model 0.480.48Vocab with Arith: model 0.640.64Vocab with Algebra: model 0.560.56Vocab with Geometry: model 0.480.48Reading with Vocab: model 0.560.561Reading with Spelling: model 0.420.42Reading with Arith: model 0.560.56Reading with Algebra: model 0.490.49Reading with Geometry: model 0.420.42Spelling with Vocab: model 0.480.48Spelling with Reading: model 0.420.421Spelling with Arith: model 0.480.48Spelling with Algebra: model 0.420.42Spelling with Geometry: model 0.360.36Arith with Vocab: model 0.640.64Arith with Reading: model 0.560.56Arith with Spelling: model 0.480.481Arith with Algebra: model 0.560.56Arith with Geometry: model 0.480.48Algebra with Vocab: model 0.560.56Algebra with Reading: model 0.490.49Algebra with Spelling: model 0.420.42Algebra with Arith: model 0.560.561Algebra with Geometry: model 0.420.42Geometry with Vocab: model 0.480.48Geometry with Reading: model 0.420.42Geometry with Spelling: model 0.360.36Geometry with Arith: model 0.480.48Geometry with Algebra: model 0.420.421
Common: explained by the factorUnique to the testOutlined cells: the selected pair

Pick two tests here, in the diagram or in the matrix.

Simulate

Vocab loads 0.80 and Reading loads 0.70 on the same factor. That factor is the only thing they share, so the model implies a correlation of 0.80 × 0.70 = 0.56. The factor explains 64% of the variance in Vocab and 49% in Reading; the rest is unique to each test.

More controls

Pressing a sample size again draws a fresh sample of that size.

2A good item and a mediocre one on the same factor

Two items measure the same factor and nothing else connects them. Item A is a good item, with a loading of 0.80. Item B is a mediocre one, with a loading of 0.50. What correlation between A and B does the model imply?

3Multiply along the path between two tests

Trace the path that joins two tests in the diagram and multiply the numbers along it: one loading, the factor correlation if the tests sit on different factors, and the other loading. Point at a symbol to see what it stands for.

λ = 0.80λ = 0.70F1 Vocab2 Readingimplied correlation = 0.80 × 0.70 = 0.56
rij  =  λi×ϕ×λj1  =  λi 2  +  uir_{ij} \;=\; \htmlClass{term-first}{\lambda_i} \times \htmlClass{term-phi}{\phi} \times \htmlClass{term-second}{\lambda_j} \qquad\qquad 1 \;=\; \htmlClass{term-common}{\lambda_i^{\,2}} \;+\; \htmlClass{term-unique}{u_i}

Point at a symbol in either formula and the matching arrow or bar lights up.

Show how one test's variance splits

The variance of Vocab, set to 1, splits in two. 0.80² = 0.64 comes from the factor, its communality, and 1 − 0.64 = 0.36 belongs to the test alone, its uniqueness u.

4Check yourself

The tasks use the controls in section 1.

  • Select two tests on the same factor, keep both loadings at 0.50 or above, and bring their implied correlation down to 0.30 or below.Now: Vocab and Reading (same factor): loadings 0.80 and 0.70, implied correlation 0.56
  • Switch to two factors and select one test from each. Raise the two loadings and φ until the pair's implied correlation reaches 0.45.Now: One factor, so there is no pair that spans two factors
  • Simulate people until every sample correlation is within 0.05 of the implied one. How many people does that take?Now: No sample yet

5Fit the one-factor model with lavaan

The code simulates 1000 people from the lab’s starting one-factor model and fits it with lavaan::cfa. The standardized loadings come back near 0.80, 0.70 and 0.60. The fitted model implies a correlation of 0.58 between Vocab and Reading, against 0.56 in the population and 0.57 in the sample.

Fit a one-factor model with lavaanShow the code
library(lavaan)
# One factor with the page's starting loadings
pop <- "g =~ 0.8*Vocab + 0.7*Reading + 0.6*Spelling +
             0.8*Arith + 0.7*Algebra + 0.6*Geometry"
set.seed(1)
dat <- simulateData(pop, sample.nobs = 1000,
                    standardized = TRUE)

# Fit the one-factor model and read the standardized loadings
fit <- cfa("g =~ Vocab + Reading + Spelling +
                 Arith + Algebra + Geometry",
           data = dat, std.lv = TRUE)
std <- standardizedSolution(fit)
round(std[std$op == "=~", "est.std"], 2)

# Vocab and Reading: population, fitted model and sample
round(c(population = 0.8 * 0.7,
        model = lavInspect(fit, "cor.ov")[1, 2],
        sample = cor(dat)[1, 2]), 2)

Uses lavaan. Install once with install.packages(c("lavaan")).

What loadings say about correlations