KPSS Test Calculator – Free Online Stationarity Test for Time Series | Stats Unlock

KPSS Test Calculator – Free Online Stationarity Test for Time Series | StatsUnlock

📥 1. Enter Your Time Series Data

Each row is one time series. The series name is editable. Comma-separated values are the default — example: 52, 48, 55, 61, 47, ...
Supports .csv, .txt, .xlsx, .xls — headers auto-detected. Click each numeric column you want to load — every selected column becomes a separate time series cluster.

⚙️ 2. Test Configuration

🧮 8. Formulas & Technical Notes

A. Formulas Used

Step 1 — Detrend the series.

e_t = y_t − μ̂ (level test) e_t = y_t − (μ̂ + β̂·t) (trend test) Where: y_t = observed value at time t μ̂ = sample mean (level test) or OLS intercept (trend test) β̂ = OLS slope on time index (trend test only) e_t = residual at time t

Step 2 — Partial sums of residuals.

S_t = Σᵢ₌₁ᵗ e_i, t = 1, 2, …, n Where: S_t = cumulative sum of residuals up to time t n = sample size

Step 3 — Long-run variance estimator (Newey-West).

σ̂²(l) = (1/n)·Σ e_t² + (2/n)·Σⱼ₌₁ˡ wⱼ(l) · Σ e_t · e_{t-j} wⱼ(l) = 1 − j/(l+1) (Bartlett kernel) Where: σ̂²(l) = long-run variance with lag truncation l wⱼ(l) = Bartlett kernel weight for lag j l = bandwidth (lag truncation parameter)

Step 4 — KPSS LM statistic.

η = (1/n²) · Σₜ₌₁ⁿ S_t² / σ̂²(l) Where: η = KPSS LM (Lagrange Multiplier) statistic S_t = partial sums (Step 2) σ̂²(l) = long-run variance (Step 3) n = sample size

Step 5 — Schwert lag rule (default).

l_short = ⌊4 · (n/100)^(1/4)⌋ l_long = ⌊12 · (n/100)^(1/4)⌋

Step 6 — Asymptotic critical values (Kwiatkowski et al., 1992, Table 1):

Typeα = 0.10α = 0.05α = 0.025α = 0.01
Level (μ)0.3470.4630.5740.739
Trend (μ+βt)0.1190.1460.1760.216

B. Technical Notes

  • Null hypothesis (H₀): the series is stationary (level- or trend-stationary).
  • Alternative (H₁): the series has a unit root (non-stationary).
  • Decision rule: reject H₀ if η > CV(α). Large η ⇒ non-stationary.
  • Bandwidth choice matters: too-small l overstates LM; too-large l understates LM. Schwert's rule is the conventional default.
  • Tables vs interpolation: p-values are interpolated linearly between the four published critical values; outside the range we report p < 0.01 or p > 0.10.
  • Pair with ADF: KPSS and ADF have opposite nulls. When both agree the conclusion is robust; when they disagree, inspect plots and consider differencing.
📚 9. When to Use the KPSS Test

This free KPSS test calculator is designed for time series analysts, econometricians, and data scientists who need a quick stationarity test calculator with effect-size context, p-value interpretation, and APA-format output for hypothesis testing in research reports.

Decision Checklist

  • Your data are a single, evenly-spaced time series (one observation per period).
  • You want to confirm stationarity before fitting AR, MA, ARMA, ARIMA, or regression models.
  • Sample size n ≥ 30; ideally n ≥ 50.
  • You can specify whether to test level- or trend-stationarity based on visual inspection.
  • Do NOT use on multivariate panel data — use a panel unit root test (Im-Pesaran-Shin, Levin-Lin-Chu).
  • Do NOT use without inspecting the time plot first — KPSS cannot detect structural breaks.
  • Do NOT rely on KPSS alone for critical decisions — pair with the ADF or Phillips-Perron test.

Real-World Examples

  1. Econometrics: Test whether monthly inflation rates are stationary before fitting an ARMA model for forecasting.
  2. Finance: Verify that daily stock returns (not prices) are stationary before applying GARCH volatility models.
  3. Climate science: Check whether de-trended global temperature anomalies are stationary around their long-run mean.
  4. Ecology: Confirm that a 50-year animal-count series is trend-stationary before testing for periodicity.
  5. Operations: Test whether daily call-centre volume is level-stationary before forecasting staffing needs.

Sample Size Guidance

  • Minimum: n ≥ 25 (results unstable below this).
  • Recommended: 50 ≤ n ≤ 500 for reliable LM statistics.
  • Very large n (n > 1000): very small departures from stationarity become "significant" — always inspect plots.

Related Tests — Decision Tree

Single time series → Stationarity check
   ├─ KPSS (H₀: stationary)        ← THIS TEST
   ├─ ADF / PP    (H₀: unit root)  ← opposite null; run both
   └─ Zivot-Andrews (H₀: unit root, allows one structural break)

Panel data → Im-Pesaran-Shin / Levin-Lin-Chu
Cointegration → Engle-Granger / Johansen
📖 10. How to Use This KPSS Test Calculator (10 Steps)
  1. Enter Your Data — paste comma-separated values into Series 1 (e.g., 52, 48, 55, 61, 47, ...), upload a CSV/Excel file, or use the manual-entry tab. Each cluster row is one time series.
  2. Choose a Sample Dataset — the dropdown offers White Noise, Random Walk, AR(1) with Trend, Inflation Rate, and Stock Returns. Dataset 1 is pre-loaded so you can run immediately.
  3. Pick Test Type — Level Stationarity (no trend) or Trend Stationarity (linear trend removed first).
  4. Select Lag — Schwert short (default), long, or custom integer. The lag controls the long-run variance estimator's bandwidth.
  5. Set Alpha — typically 0.05.
  6. Click Run KPSS Test — results appear in under a second.
  7. Read the Summary Cards — LM statistic (η), critical value at chosen α, p-value range, and the verdict (Stationary / Non-Stationary).
  8. Inspect All 4 Plots — time series with mean, partial sums St, ACF, and rolling mean/std.
  9. Read the Interpretation — six paragraphs covering result, p-value, effect, practical meaning, limitations, and next steps.
  10. Export — Download Doc (.txt) or Download PDF for journal submission.

❓ 11. Frequently Asked Questions

Q1. What is the KPSS test and when should I use it?

The KPSS test (Kwiatkowski-Phillips-Schmidt-Shin, 1992) checks whether a time series is stationary. Unlike ADF, the null hypothesis here is stationarity. Use it before fitting any AR, MA, ARMA, ARIMA, or time-series regression model.

Q2. What is a p-value, and how do I interpret it for the KPSS test?

The p-value here is the probability of seeing an LM statistic this large (or larger) if the true series were stationary. A small p (< α) means the data are inconsistent with stationarity, so we reject H₀ and conclude the series is non-stationary.

Q3. What does statistical significance mean for the KPSS test?

"Significant" here means rejecting stationarity. Even tiny non-stationarity becomes "significant" in very long series, so always confirm with a time plot and the rolling-statistics chart on this page.

Q4. What is the LM statistic and what value indicates non-stationarity?

The KPSS LM statistic η is a scaled sum of squared partial sums of residuals. Compare it to the critical values: at α = 0.05, level-test CV is 0.463 and trend-test CV is 0.146. If η exceeds the CV, the series is non-stationary.

Q5. What assumptions does the KPSS test require?

The series must be evenly spaced, finite-variance, and free of structural breaks. Heavy-tailed errors and very small samples (n < 25) can distort the LM statistic. If a structural break exists, use the Zivot-Andrews test instead.

Q6. How large a sample do I need?

At least 30 observations; 50–500 is the reliable range. Very short series produce unstable LM values; very long series become hyper-sensitive to tiny departures from stationarity.

Q7. Should I run a one-tailed or two-tailed KPSS test?

The KPSS test is inherently one-sided — we reject only when η is large (in the right tail). There is no two-tailed version, because small η simply means the data look stationary.

Q8. How do I report KPSS results in APA 7th format?

Report the LM statistic, lag, test type, critical value, and conclusion. Section 6 of this page auto-fills five reporting templates (APA, Thesis, Plain-Language, Conference Abstract, Pre-Registration) with your numbers — copy and paste.

Q9. Can I use this calculator for published research?

This tool is intended for education and exploratory analysis. For peer-reviewed work, verify with R (tseries::kpss.test or urca::ur.kpss) or Python (statsmodels.tsa.stattools.kpss). Cite STATS UNLOCK (2025). KPSS test calculator. https://statsunlock.com.

Q10. What should I do if the KPSS test rejects H₀?

Take first differences (Δyt = yt − yt−1) and re-run KPSS. If still non-stationary, difference again. The number of differences needed equals the integration order d in ARIMA(p, d, q). Most economic series are I(1) — one difference is enough.

📚 12. References

The following references support the statistical methods used in this KPSS test calculator, covering p-value interpretation, time series stationarity, and best practices in hypothesis testing.

  1. Kwiatkowski, D., Phillips, P. C. B., Schmidt, P., & Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54(1–3), 159–178. https://doi.org/10.1016/0304-4076(92)90104-Y
  2. Dickey, D. A., & Fuller, W. A. (1979). Distribution of the estimators for autoregressive time series with a unit root. Journal of the American Statistical Association, 74(366), 427–431. https://doi.org/10.1080/01621459.1979.10482531
  3. Phillips, P. C. B., & Perron, P. (1988). Testing for a unit root in time series regression. Biometrika, 75(2), 335–346. https://doi.org/10.1093/biomet/75.2.335
  4. Newey, W. K., & West, K. D. (1987). A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica, 55(3), 703–708. https://doi.org/10.2307/1913610
  5. Schwert, G. W. (1989). Tests for unit roots: A Monte Carlo investigation. Journal of Business & Economic Statistics, 7(2), 147–159. https://doi.org/10.1080/07350015.1989.10509723
  6. Hobijn, B., Franses, P. H., & Ooms, M. (2004). Generalizations of the KPSS-test for stationarity. Statistica Neerlandica, 58(4), 483–502. https://doi.org/10.1111/j.1467-9574.2004.00272.x
  7. Hamilton, J. D. (1994). Time series analysis. Princeton University Press. https://press.princeton.edu/books/hardcover/9780691042893
  8. Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: Forecasting and control (5th ed.). Wiley. wiley.com
  9. Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: principles and practice (3rd ed.). OTexts. https://otexts.com/fpp3/
  10. Cumming, G. (2014). The new statistics: Why and how. Psychological Science, 25(1), 7–29. https://doi.org/10.1177/0956797613504966
  11. American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.). APA. https://doi.org/10.1037/0000165-000
  12. R Core Team. (2024). R: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org/
  13. Trapletti, A., & Hornik, K. (2024). tseries: Time Series Analysis and Computational Finance (R package). https://CRAN.R-project.org/package=tseries
  14. Seabold, S., & Perktold, J. (2010). statsmodels: Econometric and statistical modeling with Python. Proceedings of the 9th Python in Science Conference. statsmodels.org
  15. NIST/SEMATECH. (2013). e-Handbook of statistical methods. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Next Post

© 2026 STATS UNLOCK . statsunlock.com –  All Rights Reserved.