1 Theory writes the zeros

Conventions or knowledge?

The data fix only the covariance matrix \(\Sigma\). In \(\mathbf x_t=A\boldsymbol\varepsilon_t\), the variables as the matrix \(A\) times independent shocks, every turn of \(A\) fits equally well.

  • Conventions picked a turn so far: PCA, varimax, promax. Easy to describe, silent on why.
  • Knowledge picked one for the flights: the manualโ€™s fuel flow fixed the headwind arrow.

Confirmatory models write down in advance what moves what. Every effect not written down is zero. The data estimate the rest and test the zeros.

  • Confirmatory factor analysis: zeros in the loadings.
  • Simultaneous equations: observed variables that affect each other.
  • Structural equation models: both at once.

Exploratory or confirmatory

The six simulated tests of Chapter 6. Exploratory: the data find the groups, and we name the factors afterwards. Confirmatory: theory says which test measures which ability. A missing arrow is a loading fixed at zero.

Circles: unobserved (latent). Boxes: measured. \(u_i\): test \(i\)โ€™s own shock, with variance \(\psi_i\). \(\lambda_i\): loadings. \(\varphi\): the correlation of the two abilities.

Writing the model down

\[ \begin{aligned} x_{t1}&=\lambda_1f_{t1}+0\cdot f_{t2}+u_{t1}\\ x_{t2}&=\lambda_2f_{t1}+0\cdot f_{t2}+u_{t2}\\ x_{t3}&=\lambda_3f_{t1}+0\cdot f_{t2}+u_{t3}\\ x_{t4}&=0\cdot f_{t1}+\lambda_4f_{t2}+u_{t4}\\ x_{t5}&=0\cdot f_{t1}+\lambda_5f_{t2}+u_{t5}\\ x_{t6}&=0\cdot f_{t1}+\lambda_6f_{t2}+u_{t6} \end{aligned} \]

\(x_{ti}\): score of student \(t\) on test \(i\) (reading, vocabulary, grammar, arithmetic, algebra, geometry).

\(f_{t1}\), \(f_{t2}\): verbal and mathematical ability, each with variance one and correlation \(\varphi\).

\[\Sigma=\Lambda\Phi\Lambda'+\Psi,\qquad \Phi=\begin{pmatrix}1&\varphi\\ \varphi&1\end{pmatrix}\]

\(\Lambda\): the loadings, with the six zeros. \(u_{ti}\): the testโ€™s own shock. \(\Psi\): the unique variances \(\psi_i\) on its diagonal.

The zeros fix the turn

Loadings are coordinates, read parallel to the other axis. Dashed: the loadings fixed at zero.

Units and counting

The zeros identify the factors and fix their names: there is no rotation step.

Each ability still needs a unit, since doubling it and halving its loadings fits equally well. Two choices, same fit:

  • Variance one: the ability is measured in standard deviations (std.lv = TRUE).
  • A marker (reference indicator): an observed variable whose loading is fixed at one. It marks the unit: one unit more of the ability moves the marker by one of its own units. lavaanโ€™s default: the first variable of each factor.

Counting: \(\Sigma\) holds \(6\cdot7/2=21\) numbers, 6 variances and 15 covariances. The model has 13 parameters: 6 loadings, 6 unique variances and \(\varphi\). So \(\text{df}=21-13=8\), against 4 for the exploratory model.

A non-negative count is needed but not enough. Rules of thumb (Bollen 1989): three variables that measure only one factor identify it, or two if the factor correlates with another.

2 Fitting and testing

The model in lavaan

library(lavaan)
model <- "
  verbal =~ reading + vocabulary + grammar
  math   =~ arithmetic + algebra + geometry"
fit <- cfa(model, data = as.data.frame(tests_X), std.lv = TRUE)
fitMeasures(fit, c("chisq", "df", "pvalue"))
##  chisq     df pvalue 
##  3.323  8.000  0.913
  • =~ reads “is measured by”.
  • ~~ adds a covariance.
  • ~ adds an equation and reads “is explained by”.
  • std.lv = TRUE gives each factor variance one. Without it, the first test is the marker (reference indicator).
  • summary(fit) lists every estimate with its standard error.

The estimates

Loadings close to the true 0.8, 0.7 and 0.6. The abilities correlate 0.53 (true 0.5), more than the average scores, 0.38: the model removes the testsโ€™ noise, a disattenuated correlation.

Exploratory and confirmatory loadings

The main loadings agree. Promax estimates all twelve and leaves the small cross-loadings to interpretation. The confirmatory model fixes them at zero, and tests whether it may.

The test

Like factanal(), lavaan estimates by maximum likelihood: it makes

\[F_{\text{ML}}=\ln|\Sigma|+\operatorname{tr}(S\Sigma^{-1})-\ln|S|-p,\qquad \Sigma=\Lambda\Phi\Lambda'+\Psi\]

as small as possible, with the zeros fixed. \(S\): the sample covariance matrix of the \(p\) variables.

The statistic \(n\cdot F_{\text{ML}}\) at its minimum is approximately chi-square with df degrees of freedom if the model is right.

Six tests: 3.3 on 8 degrees of freedom, p-value 0.91. No sign against the zeros.

3 When the model does not fit

Critics who dine together

When critics 3 and 4 dine together, one factor is rejected (20.8 on 2 degrees of freedom). Freeing the covariance of their quirks, critic3 ~~ critic4, fits. Freeing the other pair fits equally well, but needs a negative variance, a Heywood case.

How large is the misfit?

With many observations the test rejects even tiny misfits. Fit indices measure how large a misfit is.

  • RMSEA, root mean square error of approximation: the misfit per degree of freedom, beyond what noise produces, \(\sqrt{\max\big((\chi^2-\text{df})/(\text{df}\cdot n),\,0\big)}\). Good: at most 0.06.
  • CFI, comparative fit index: the share of the misfit of a baseline model, with all variables uncorrelated, that the model removes. Good: at least 0.95.
  • SRMR, standardised root mean square residual: the root mean square of the residual correlations, sample minus model. Good: at most 0.08.

\(\chi^2\): the test statistic, df: its degrees of freedom, \(n\): the number of observations. The guides are from Hu and Bentler (1999). They are guides, not tests.

Nine tests from 1939

Holzinger and Swineford (1939): 301 students, nine tests for three abilities, visual, textual and speed. Standardised estimates, so \(\psi_i\) is the uniqueness.

The test rejects

RMSEA 0.092, CFI 0.931, SRMR 0.065: a moderate misfit, not a dramatic one.

Where is the misfit?

The capitals test correlates more with the visual tests perception and lozenges than the model allows.

Modification indices

How much would \(\chi^2\) drop if a fixed parameter were freed?

mi <- modindices(hs_cfa, sort. = TRUE)
head(mi[, c("lhs", "op", "rhs", "mi")], 3)
##       lhs op rhs     mi
## 30 visual =~  x9 36.411
## 76     x7 ~~  x8 34.145
## 28 visual =~  x7 18.631

Freeing a loading of capitals on visual: \(\chi^2\) falls from 85.3 to 52.4. Telling straight from curved letters takes visual perception.

x7, x8, x9: the speed tests addition, dots and capitals. =~ is a loading, ~~ a covariance of two quirks.

A change suggested by the data is no longer confirmed: test it on fresh data.

4 Simultaneous equations

A fish market

\[ \begin{aligned} &\text{supply:} &\text{quantity}_t&=-6+4\,\text{price}_t-3\,\text{storm}_t+\delta_1\varepsilon_{t1}\\ &\text{demand:} &\text{price}_t&=9-0.5\,\text{quantity}_t+\delta_2\varepsilon_{t2} \end{aligned} \]

Price and quantity are both outcomes: each day the market settles where the curves cross.

A supply shock moves the market along the demand curve, a demand shock along the supply curve.

\(\varepsilon_{t1}\), \(\varepsilon_{t2}\): independent supply and demand shocks with variance one; \(\delta_1=1\), \(\delta_2=0.5\): their standard deviations. \(\text{storm}_t=1\) on stormy days.

Regression traces neither curve

Calm days only. If one curve shifts, the days trace the other. If both shift, the regression line lies in between, here with slope 0.17: neither the \(-0.5\) of demand nor the \(0.25\) of supply. Regression picks the Cholesky \(A\), as if quantity were set first.

Which shocks dominate?

Now with stormy days (dark). Left end: supply shocks only. Right end: demand shocks only.

Storms reveal the demand curve

A storm shifts supply only, so it moves the market along the demand curve.

Slope through the two centres:

\[\frac{\operatorname{Cov}(\text{price},\text{storm})}{\operatorname{Cov}(\text{quantity},\text{storm})}=-0.56\]

The instrumental variable estimate. It works because buyers ignore the weather at sea: the storm is excluded from demand.

The system in matrix form

\[ \mathbf x_t=B\,\mathbf x_t+\Delta\boldsymbol\varepsilon_t,\qquad B=\begin{pmatrix}0&4&-3\\ -0.5&0&0\\ 0&0&0\end{pmatrix},\qquad A=(I-B)^{-1}\Delta \]

\(\mathbf x_t\): quantity, price, storm. \(B\) (capital beta): who affects whom. Its zeros are the restrictions, such as storms staying out of demand. \(\Delta\): the standard deviations of the shocks.

6 numbers in \(\Sigma\), 6 parameters (three effects, three standard deviations): just identified.

5 Structural equation models

Measurement and structure

\[ \underbrace{\mathbf x_t=\Lambda\mathbf f_t+\mathbf u_t}_{\text{measurement}}\qquad\qquad \underbrace{\mathbf f_t=B\,\mathbf f_t+\Delta\boldsymbol\varepsilon_t}_{\text{structure}} \]

  • Measurement: the observed variables \(\mathbf x_t\) measure the latent ones \(\mathbf f_t\), as in confirmatory factor analysis.
  • Structure: the latent variables affect each other, as in simultaneous equations.
  • Confirmatory factor analysis is \(B=0\): the latent variables only correlate. Simultaneous equations are \(\Lambda=I\), \(\Psi=0\): every latent variable measured exactly.

\(\Lambda\): the loadings. \(\mathbf u_t\): the unique shocks, with variances \(\Psi\). \(B\): the effects of the latent variables on each other. \(\Delta\boldsymbol\varepsilon_t\): their own shocks, with standard deviations \(\Delta\), uncorrelated unless the model lets two correlate.

A grade a year later

A year after the six tests, the 200 simulated students take a statistics course. Their grade depends only on mathematical ability \(f_{t2}\), which has variance one:

\[\text{grade}_t=70+\beta f_{t2}+\delta\varepsilon_t,\qquad \beta=6,\quad \delta=8\]

The diagram shows these true values. We see the test scores and the grade, not the ability: how large is \(\beta\)?

Why not regress on the average score?

The average of the three math scores is ability plus noise. The noise adds to its variance but not to its covariance with the grade. This is attenuation: \(\text{slope}=\beta\times\text{reliability}=6\times0.745\), where the reliability is the share of the averageโ€™s variance that comes from the ability.

The structural equation model

math  =~ arithmetic + algebra + geometry
grade ~  math

\(\hat\beta=6.19\), close to the true 6. The covariance of the grade with a test, \(\beta\lambda_i\), holds none of the testโ€™s noise.

Industrialisation and democracy

Bollen (1989), 75 countries, standardised estimates. Democracy in 1960 and 1965 (dem60, dem65) is measured by four expert ratings (y1 to y4, y5 to y8), industrialisation in 1960 (ind60) by three indicators (x1 to x3).

Direct and indirect effects

Ordered by time: ind60, then dem60, then dem65. The same rating in 1960 and 1965 shares its quirks, as do two ratings from the same source (grey curves in the figure).

  • Direct effect of ind60 on dem65: 0.18.
  • Indirect effect, through dem60: the product of the arrows, \(0.45\times0.89=0.40\).
  • Total effect: 0.58. Industrialisation mattered for democracy in 1965 mostly through the democracy it already went with in 1960.
dem60 ~ a * ind60
dem65 ~ c * ind60 + b * dem60
indirect := a * b              # a, b, c name the arrows

The model fits: \(\chi^2\) 38.1 on 35 degrees of freedom. Without the shared quirks it does not.

6 What the arrows mean

Equivalent models

Opposite arrows, the same fit: the direction cannot come from \(\Sigma\). Here it comes from time, since the tests came a year before the course. The two pairs of critics who might dine together were another case, and so was the market without storms.

The data fix the reduced form \(\Sigma\). The arrows and zeros of the structural form come from outside the data.

Correlations are still correlations

  • A model that fits is not proven: “correlational data are still correlational” (Cliff 1983).
  • A variable left out, such as motivation behind both the tests and the grade, is credited to the arrows that are in the model.
  • Maximum likelihood assumes normal data. For ratings with few categories, lavaan has ordered.
  • The chi-square test needs large samples: with 75 countries, its p-value is approximate.

Takeaways

  • Confirmatory factor analysis: theory fixes zeros in the loadings. They fix the turn and the names, and the chi-square test checks them.
  • Fit indices say how large a misfit is, residuals where it sits. Modification indices give hints for fresh data.
  • Simultaneous equations: \(A=(I-B)^{-1}\Delta\). A regression traces neither curve. An instrument identifies one.
  • Structural equation models: measurement plus structure, without attenuation, with direct and indirect effects.
  • Equivalent models fit equally well with different arrows.

Theory writes the zeros and the arrows. The data estimate the rest and test what was written.