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.
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.
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.
\[ \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.
Loadings are coordinates, read parallel to the other axis. Dashed: the loadings fixed at zero.
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:
std.lv = TRUE).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.
lavaanlibrary(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.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.
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.
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.
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.
With many observations the test rejects even tiny misfits. Fit indices measure how large a misfit is.
\(\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.
Holzinger and Swineford (1939): 301 students, nine tests for three abilities, visual, textual and speed. Standardised estimates, so \(\psi_i\) is the uniqueness.
RMSEA 0.092, CFI 0.931, SRMR 0.065: a moderate misfit, not a dramatic one.
The capitals test correlates more with the visual tests perception and lozenges than the model allows.
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.
\[ \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.
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.
Now with stormy days (dark). Left end: supply shocks only. Right end: demand shocks only.
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.
\[ \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.
\[ \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}} \]
\(\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 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\)?
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.
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.
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).
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).
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.
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.
lavaan has ordered.Theory writes the zeros and the arrows. The data estimate the rest and test what was written.