Show observation scores and variable directions in the same reduced-dimensional view.
| Variable | PC1 loading | PC2 loading |
|---|---|---|
| Diabetes | -2.71 | 1.06 |
| Obesity | -2.22 | -0.06 |
| COPD | -2.71 | -0.99 |
| Heart dis. | -2.83 | -0.36 |
| Depression | -1.02 | -2.33 |
| Arthritis | -2.27 | -1.61 |
| Asthma | -1.52 | -1.85 |
| Stroke | -2.8 | 0.44 |
| High chol. | -1.84 | 0.48 |
| Cancer | 1.17 | -2.51 |
| High BP | -2.67 | 0.37 |
| Fair/poor | -2.82 | 0.71 |
| Mental dist. | -2.48 | -1.21 |
| Phys. dist. | -2.83 | -0.15 |
| Inactivity | -2.65 | 0.77 |
| Binge drink | 1.9 | -0.65 |
| Short sleep | -2.32 | 0.37 |
| Smoking | -2.61 | -0.89 |
| ADI | -2.75 | 0.28 |
| ADI:Finance | 2.13 | 0.64 |
The chart labels the 12 longest loadings; the table includes all variables. Correlation-based PCA (variables standardized). Scores and loadings co-scaled for a proper biplot.
Captured ZIP health and deprivation PCA reference fixture
The cloud contains observation scores. Nearby arrow directions suggest variables that align in this projection. Axis labels report the variance captured by each component.
Exploring correlated multivariate data after the analysis and its standardization choices have been established.
Do not treat two dimensions as the whole dataset, infer causation, or read absolute arrow lengths as original measurement units.
scores: { x, y }[]; loadings: { x, y, label }[]; variance: { x, y } in 0–1 proportions, not 0–100 percentages.
Filter invalid scores and loadings without silently replacing them with zeros. Document upstream handling of missing survey answers.
The reusable component spreads loading labels and limits their number for legibility. A separate table lists every loading, including any not labelled on the plot.
Install from the CTZN registry, then pass your prepared rows. Examples below illustrate the component contract.
npx shadcn add @ctzn-viz/pca-biplot<PcaBiplot scores={scores} loadings={loadings}
variance={{ x: 0.42, y: 0.18 }}
ariaLabel="Principal components of survey attitudes" />