Linear Regression Visualizer

[日本語版] Last-updated: May 10, 2026. Developed by Claude (code) and liangz (design). This work is part of a Nonproportinal Indicator project led by Prof. Liang Zhao which was partially supported by SMBC KU Studio (Aug 2025 - Jul 2026), KAKENHI 23K10997 (Apr 2023 - Mar 2026), 18K11182 (Apr 2018 - Mar 2023), 25330026 (Apr 2013 - Mar 2017).

How it works
  1. Paste CSV data below. The first row is a header (e.g. col1, col2); subsequent rows are x, y pairs. An optional third column may carry a per-row label. The default is the population and number of seats for G20 countries (except EU), according to IPU (Inter-Parliamentary Union) in 2021.
  2. Click Submit. Four regressions are fit in parallel:
    • M1: y = ax + b on the raw data
    • M2: y = ax on the raw data (intercept forced to 0)
    • M3: log10(y) = a·log10(x) + b on the log-transformed data
    • M4: log10(y) = a₀·log10(x) + b, where a₀ is a user-specified slope (default 1)
  3. Each figure shows its data (distinct non-red colors) and its model line (red), with the formula, adjusted R², and slope p-value above.
  4. Shared axes: Figures 1 & 2 share one X/Y range, and Figures 3 & 4 share another, for direct comparison.
  5. Hover over a point and stay still for 1 second to see its label (if one was provided in the third CSV column). Click to animate it from (Xi, Yi) to (X1, Yi + a(X1 − Xi)). Mouse wheel zooms; drag pans; double-click resets. NOTE: This visualizes comparasion with respect to the model (e.g., the so-called malapportionment issue, 一票の格差 in Japanese, assumes model M4 (same as M2 but in log). In fact, any comparision in the form of Y/X assumes model M4 (same as M2 but in log).
  6. You can change M4's fixed slope using the input next to its title; M4 (and the M3/M4 shared axes) update immediately.