Skip to content
svgparallel-analysis

Parallel analysis

How many factors stand out above what random data would produce?

Demo data · seed 20261101 · 24 rows · default settings · 640 × 360SVG, lightSVG, darkDemo CSV

How to read it

  1. Read the solid line as your data's eigenvalues.
  2. Read the dashed line as those of random data of the same size.
  3. Keep factors where the solid line stays above the dashed one.
  1. Callout 1: The first factor stands far above random.
  2. Callout 2: The last factor above random.
  3. Callout 3: Below random: noise.

Watch out

  • It's a guide: factor interpretation still decides what to keep.

Defaults

No settings: the chart draws one way.

Pinned in the code

  • Draws the run's numbers as given (computed by the Python/R engine); the chart computes nothing statistical.
  • Retained = the leading run of factors whose observed eigenvalue exceeds the simulated one (the 95th percentile or the mean of the simulations, as the engine sends). The Kaiser line is shown for reference only — it over-extracts.
# Parallel analysis — Codesplash Chart Lab (recipe "parallel-analysis")
# controls: defaults
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

try:
    import codesplash as cs  # optional: the app's chart theme
except ImportError:
    cs = None
if cs:
    cs.use_codesplash(dark=False)
PALETTE = cs.palette(dark=False)["categorical"] if cs else plt.rcParams["axes.prop_cycle"].by_key()["color"]

df = pd.read_csv("parallel-analysis-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["kind"] = pd.Categorical(df["kind"].astype("string"), categories=["observed", "simulated (95th percentile)"])

F = "factor"
E = "eigenvalue"
K = "kind"
fig, ax = plt.subplots(figsize=(8, 4.5))
for name, d in df.dropna(subset=[F, E]).sort_values(F).groupby(K, observed=True, sort=False):
    sim = any(w in str(name).lower() for w in ("sim", "random", "parallel"))
    ax.plot(d[F], d[E], marker="o", ms=4, color="grey" if sim else PALETTE[0], linestyle="--" if sim else "-", linewidth=1.6 if sim else 2, label=str(name))
ax.axhline(1, color="grey", linestyle=":", linewidth=1)
ax.set_xlabel(F)
ax.set_ylabel(E)
ax.legend(fontsize=8)
plt.show()

Needs pandas, numpy, matplotlib · reads parallel-analysis-demo.csv · app theme from the optional codesplash helper