Matrix Algebra for PCA-Based State Effects
How quarterly state house-price histories become three continuous variables in a county cross-section.
1. Construct the state history matrix
Let X be a T × S matrix. Each column contains quarterly log growth in the All-Transactions House Price Index for one state or the District of Columbia. In this analysis, S = 51 and T = 195.
Because states have different means and volatilities, each column is standardized:
2. Decompose the correlation matrix
The standardized matrix produces the state correlation matrix:
Principal component analysis performs the eigendecomposition:
The diagonal matrix Λ contains eigenvalues ordered from largest to smallest. The columns of V are orthonormal eigenvectors. RainbowStats uses the state entries in these eigenvectors as the displayed component weights.
| Component | Individual variance | Cumulative variance |
|---|---|---|
| PC₀ | 29.89% | 29.89% |
| PC₁ | 10.21% | 40.10% |
| PC₂ | 6.78% | 46.89% |
3. Map state coordinates to counties
Let s(i) identify the state containing county i. For the first three components, county i receives the row of V belonging to its state:
The 2024 county regression is then:
Here, y is county house-price growth and w contains county personal-income growth, listing growth and nominal GDP growth.
4. Why this differs from state dummy variables
With state dummies, county i receives a one in its state's column and zero in every other state column. The coefficient for one state is unrelated by construction to the coefficient for another.
With PCA state effects, each state receives a three-number coordinate. States with similar historical housing dynamics tend to have similar coordinates. The model therefore uses a low-dimensional description of housing-market structure rather than a collection of unrelated labels.
5. Orthogonality and the selected-state cross-section
The eigenvectors are orthogonal in the full 51-state PCA. Once the analysis keeps only eight states and repeats each state's coordinates for all of its counties, the county-level PCA columns need not remain perfectly uncorrelated. Unequal county counts implicitly reweight the state rows.
This explains why a correlation matrix calculated after county selection does not necessarily show exact zeros between the PCA variables. The PCA itself is not corrupted; the regression sample is a restricted and reweighted projection of the original state space.
6. The rank limit
The county sample contains eight states, so there are only eight distinct PCA loading profiles. The intercept is another between-state vector and consumes one degree of freedom. Consequently:
Attempting to include ten components makes the design matrix singular. With seven components, and assuming the restricted loading matrix has full rank, the PCA columns plus the intercept span the same between-state space as seven state dummies. At that point PCA is a rotation of the fixed-effect basis, not meaningful dimension reduction.
The three-component model is substantively different: it deliberately restricts the state effect to the leading historical housing patterns.
7. Seven-component robustness check
| Component | Coefficient | t-statistic |
|---|---|---|
| PC₀ | −0.141 | −2.488 |
| PC₁ | 0.069 | 4.980 |
| PC₂ | 0.074 | 6.362 |
| PC₃ | 0.035 | 1.837 |
| PC₄ | 0.029 | 0.641 |
| PC₅ | −0.045 | −0.994 |
| PC₆ | 0.072 | 1.019 |
R² rises from 0.406 with three components to 0.451 with seven; adjusted R² rises from 0.389 to 0.424. The added components are not individually strong. The first three remain the stable, interpretable factors.
8. Nominalizing county GDP
Nominal GDP growth equals real GDP growth plus GDP-deflator growth:
For the 2024 cross-section, interpolated GDP-deflator growth is 0.025125, approximately 2.51%. This value is identical for every county. With an intercept, adding a common constant to one regressor changes the intercept but cannot change cross-sectional slopes, fitted values, residuals or R².
9. Interpretation limits
- Large t-statistics establish conditional association under the regression assumptions; they do not establish causality.
- PCA components are statistical combinations, not directly observed economic variables.
- The sign of an eigenvector is arbitrary. Reversing every loading and the corresponding regression coefficient leaves fitted values unchanged.
- Every county in a state receives the same loading vector, so the method softens but does not eliminate the state boundary.
- The regression is a single 2024 cross-section covering eight states and should be expanded before making national claims.