Principal component analysis
What it is
Principal component analysis (PCA) takes a set of numeric fields that overlap and rebuilds them as a few new combined measures, called components, that carry most of the information. The first component is the single weighted blend of your fields that varies the most across rows; the second is the next most varying blend that is unrelated to the first, and so on. Ten overlapping survey items often collapse into one or two components.
It is a way to ask how many separate things your fields are really measuring, and which fields belong to which.
When to use it
- You have many correlated fields and want a handful of summary scores.
- You want to know whether a battery of items measures one idea or several.
- You want to reduce overlap before a regression or a clustering.
If you believe a hidden trait causes the answers and want to model that, look at factor analysis (MAT_FACTOR) instead. PCA just summarises; it makes no claim about causes. The Measure a construct guide shows when to reach for which, with a worked reliability story on a six-item battery.
How to read it in Pulse
List the fields on a MAT_PCA matrix (inline as fields, or once as a named vector in the request’s vectors block) (pulse examples show principal_components prints a runnable request; its cohorts: Get the data). Check these in order:
- Is it worth doing? The result reports a KMO figure (the Kaiser-Meyer-Olkin measure of how well the fields share variation, from 0 to 1; higher is better) and Bartlett’s sphericity test (are the fields related at all). If they fail, the fields have too little in common to summarise.
- How many components?
eigenvalues,explained_varianceandcumulativelist every component with its share of the total variation. An eigenvalue is the amount of variation a component carries, counted in fields: on the default correlation basis each field brings 1, so an eigenvalue above 1 carries more than a single field does. A big first share and then a sharp drop means one dominant dimension. By default Pulse keeps components with an eigenvalue above 1; setparams.componentsto choose a number or a variance share. - What does each mean? The
primaryblock holds the loadings: one row per field, one column per component (PC1,PC2, …). Large loadings, in size, say which fields make up a component; name the component after them. - Per-field fit.
communalitiessay how much of each field the kept components explain; a low one means the field does not belong with the rest.
Component signs are arbitrary: a flipped sign says nothing. Only the pattern of large and small loadings matters.
To put a component on every row, add ATTR_PC_SCORE with the component number: each row gets its standardized score, which you can then average by group or feed to a regression.
Common traps
- Scale matters. The default works on correlations, so field units do not dominate. Working on covariances (
params.on) lets large-unit fields take over; use it only on purpose. - Too few rows. Components built from a small sample are unstable. Check the row count in the result’s components before reading detail.
- Reading too much into small loadings. Focus on the largest ones.
- Rotation.
params.rotationmakes components easier to name, but it spreads the variation across them, so readrotated_varianceafterwards. - Missing data.
listwisedrops whole rows;pairwisecan give an inconsistent grid (PULSE_MATRIX_NOT_PSD), whichparams.repaircan fix.
Where next
- Operators:
op-mat-pca,op-attr-pc-score,op-mat-factor,op-mat-reliability. - Guides: Measure a construct.
- Skills: multivariate-outputs, multivariate-design.
- Related concepts: correlation matrix, perceptual maps.
- Glossary: principal-component, eigenvalue, loading.