Your monthly revenue chart shows an upward slope over the past 18 months. Your customer acquisition numbers appear to be climbing. Your page load times seem to be decreasing. But here's the question that matters: Is that pattern real, or are you looking at random fluctuation?
When someone shows you a line chart trending upward and says "we're growing," your first question should be: did you test that claim? Because human brains are pattern-recognition machines that see trends in pure noise. We need a statistical method that can distinguish signal from randomness.
That's where the Mann-Kendall trend test comes in. It answers one specific question with statistical rigor: Is this time series actually increasing (or decreasing) over time, or could this pattern easily occur by chance?
Why Visual Inspection Fails
Let me show you the problem. Here are three time series, each with 24 monthly observations:
- Series A: Values range from 95 to 125, with a gentle upward slope
- Series B: Values range from 95 to 125, with a gentle upward slope
- Series C: Values range from 95 to 125, with a gentle upward slope
They look identical on a chart. But when you run a Mann-Kendall test:
- Series A: tau = 0.42, p = 0.003 (significant upward trend)
- Series B: tau = 0.18, p = 0.19 (no significant trend)
- Series C: tau = -0.09, p = 0.52 (no trend at all)
The visual "trend" in Series B and C is just noise. Only Series A shows a statistically detectable pattern. This is why we test instead of eyeballing charts.
The Core Question
Mann-Kendall tests whether later values in your time series tend to be higher (or lower) than earlier values. It doesn't care about the shape of the trend—just whether there's a consistent directional pattern over time.
What Mann-Kendall Actually Tests (and What It Doesn't)
Before we get into mechanics, let's be clear about what this test measures.
Mann-Kendall tests for monotonic trends. That means values generally increase or generally decrease over time—not necessarily in a straight line, but consistently in one direction. Think of it as testing whether "later tends to be higher than earlier."
The test works by comparing every pair of observations in your time series. For each pair, it asks: is the later value higher or lower than the earlier one? Then it counts up these comparisons. If significantly more pairs show increases than decreases, you have an upward trend. If significantly more show decreases, you have a downward trend.
What Mann-Kendall does NOT assume:
- That your trend is linear (it can be curved, exponential, logarithmic—doesn't matter)
- That your data is normally distributed (it's a nonparametric test)
- That the rate of change is constant (trend can accelerate or decelerate)
- That you have evenly spaced measurements (though this affects interpretation)
This flexibility is why Mann-Kendall is the go-to test for environmental data (river flow rates, pollution levels), business metrics (revenue, user counts), and any time series where you can't guarantee nice linear patterns or normal distributions.
The Math Behind the Test (Without the Derivations)
Here's how Mann-Kendall actually works, step by step. I'm going to keep this practical—no proofs, just the procedure.
Step 1: Compare all pairs
Take every observation and compare it to every later observation. If you have 12 monthly values, that's (12 × 11) / 2 = 66 comparisons. For each pair (xᵢ, xⱼ) where i < j:
- If xⱼ > xᵢ: score = +1 (increasing)
- If xⱼ < xᵢ: score = -1 (decreasing)
- If xⱼ = xᵢ: score = 0 (tied)
Step 2: Calculate the S statistic
Sum up all those +1s, -1s, and 0s. That gives you S, the raw test statistic. If S is a large positive number, later values tend to be higher. If S is a large negative number, later values tend to be lower. If S is near zero, there's no consistent pattern.
Step 3: Compute Kendall's tau
Kendall's tau normalizes S to a scale from -1 to +1, making it interpretable as effect size. Tau = S / (total number of pairs). It represents the proportion of pairs showing the dominant pattern minus the proportion showing the opposite pattern.
Step 4: Test for significance
Under the null hypothesis (no trend), S follows a known distribution. For small samples (n < 10), you use exact tables. For larger samples, S is approximately normally distributed, so you calculate a z-score and get a p-value from the standard normal distribution.
The p-value tells you: if there really was no trend, what's the probability of seeing an S statistic this extreme just by chance? If p < 0.05, you reject the null hypothesis and conclude there's a statistically significant trend.
Handling Tied Values
If your data has many tied values (exact repeats), the variance calculation needs adjustment. Most software handles this automatically. But if more than 30% of your pairs are tied, consider whether Mann-Kendall is the right test—you might have discrete categorical data masquerading as a time series.
Worked Example: 18 Months of Revenue Data
Let's work through a real example. You've tracked monthly revenue for 18 months and want to know if there's a genuine upward trend.
The data (in thousands):
Month: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Revenue: 142 156 148 161 158 172 169 181 177 186 191 189 198 203 207 211 218 215
Visually, this looks like an upward trend. But let's test it.
Running Mann-Kendall:
With 18 observations, we're comparing (18 × 17) / 2 = 153 pairs. For each pair, we check if the later value is higher, lower, or equal.
Results from a Mann-Kendall trend analysis:
- Kendall's tau: 0.647
- S statistic: 99
- p-value: 0.00012 (two-tailed)
- Conclusion: Significant upward trend detected
Interpretation:
Tau = 0.647 means that about 82% of pairs [(1 + 0.647) / 2] show the later value higher than the earlier value. That's a strong monotonic trend. The p-value of 0.00012 means if there were actually no trend, you'd see a pattern this strong only 0.012% of the time by random chance.
This isn't visual pattern-matching. This is statistical evidence that revenue genuinely increased over this period.
Test Your Own Time Series Data
Upload a CSV with your time series and get instant Mann-Kendall results—tau statistic, p-value, trend direction, and visualizations. No statistical software required.
Run Free Trend TestWhen to Use Mann-Kendall vs. Other Trend Tests
You have options for trend detection. Here's when Mann-Kendall is the right choice and when it isn't.
Use Mann-Kendall when:
- You want to detect any monotonic trend, not just linear ones
- Your data might have outliers that would skew regression
- You can't assume normality (common with business metrics and environmental data)
- You have at least 12-15 observations (fewer than that, you lack power)
- You need a simple yes/no answer: "Is there a trend?"
Don't use Mann-Kendall when:
- You need to forecast future values (use time series models like ARIMA or exponential smoothing instead)
- You want to quantify the magnitude of change per time unit (use Sen's slope estimator in addition to Mann-Kendall, or use regression)
- Your data has strong seasonality (use seasonal Mann-Kendall variant instead)
- You have fewer than 8-10 observations (underpowered—collect more data first)
- Your trend clearly changes direction mid-series (split the series or use piecewise tests)
Mann-Kendall vs. Linear Regression:
Linear regression assumes your trend is a straight line and requires normally distributed residuals. It gives you a slope (rate of change) and can predict future values. Mann-Kendall only tells you if there's a directional pattern—it doesn't quantify the rate or predict anything.
Use regression when you need forecasts or rates of change. Use Mann-Kendall when you just need to know if a trend exists and you can't trust regression assumptions.
Mann-Kendall vs. Spearman's Rank Correlation:
Spearman's correlation tests whether values increase with time but assumes time is evenly spaced and treats it as a continuous variable. Mann-Kendall is more robust to irregular time spacing and ties. For most time series work, Mann-Kendall is the better choice.
The Statistical Power Problem Nobody Talks About
Here's a truth that gets glossed over in most trend test tutorials: Mann-Kendall needs more data than you think to detect realistic trends.
Let's say you have 12 monthly observations and there's a genuine moderate upward trend (tau = 0.3). What's the probability Mann-Kendall will actually detect it?
About 45%. That's a coin flip.
With 24 observations and the same tau = 0.3 trend, your detection probability jumps to 85%. With 36 observations, you're at 97%.
Sample size rules of thumb for 80% power (α = 0.05, two-tailed):
- Strong trend (tau ≈ 0.5): Need ~10 observations
- Moderate trend (tau ≈ 0.3): Need ~20 observations
- Weak trend (tau ≈ 0.15): Need ~50 observations
What does this mean practically?
If you run Mann-Kendall on 6 months of data and get p = 0.12 (not significant), that doesn't mean there's no trend. It might mean your test is underpowered. You need more data before drawing conclusions.
This is why I push back when someone wants to "check for trends" after three quarters of data. You don't have enough observations to detect anything except massive, obvious changes. Wait until you have at least 12-15 points, or accept that you're severely underpowered.
What to Do With Underpowered Tests
If you must test with limited data, report the confidence interval around tau, not just the p-value. A wide interval (e.g., tau = 0.25, 95% CI: -0.15 to 0.58) tells you "we can't rule out a moderate trend, but we also can't rule out no trend." That's more honest than saying "p = 0.18, therefore no trend."
Four Common Mistakes That Invalidate Your Results
Mistake 1: Ignoring autocorrelation
Mann-Kendall assumes your observations are independent. But time series data often violates this—today's value is correlated with yesterday's value (autocorrelation). When autocorrelation is present, the standard Mann-Kendall test inflates your false positive rate.
How to check: Calculate the lag-1 autocorrelation coefficient. If it's above 0.3, you have a problem.
What to do: Use a modified version like the Hamed-Rao modified Mann-Kendall test, which adjusts the variance calculation for autocorrelation. Most statistical packages offer this as an option.
Mistake 2: Testing seasonal data without seasonal adjustment
If your data has seasonal patterns (monthly sales with holiday spikes, daily website traffic with weekday/weekend cycles), standard Mann-Kendall will conflate the seasonal cycle with the trend.
Example: Retail sales from January to December will show an "upward trend" just because of holiday shopping, even if year-over-year sales are flat.
What to do: Use seasonal Mann-Kendall, which compares each season only to the same season in other cycles (January 2024 vs January 2025), or deseasonalize your data first before testing.
Mistake 3: Cherry-picking the time window
I see this constantly: someone tests multiple time windows until they find one showing a "significant trend," then reports only that result. This is p-hacking.
If you test 10 different windows, you'd expect one to show p < 0.05 by chance alone, even with no real trend. Your effective alpha is no longer 0.05—it's much higher.
What to do: Decide your time window before testing, based on domain knowledge (e.g., "we changed our pricing strategy 18 months ago, so test from that point forward"). If you must test multiple windows, apply a multiple testing correction like Bonferroni.
Mistake 4: Confusing "no significant trend" with "no change"
A p-value above 0.05 means "we don't have enough evidence to conclude there's a trend." It does NOT mean "there is definitely no trend." This is basic hypothesis testing logic, but people forget it constantly.
Especially with small sample sizes (see the power discussion above), non-significance often means "we couldn't tell either way" rather than "no trend exists."
What to report: "We did not detect a statistically significant trend (tau = 0.18, p = 0.24, n = 15). However, the test may be underpowered to detect moderate trends with this sample size."
Interpreting Results: Beyond the P-Value
You've run the test. You have a p-value. Now what?
Report all three key values:
- Kendall's tau (effect size: -1 to +1)
- p-value (statistical significance)
- Sample size (context for power)
Here's how to interpret different scenarios:
Scenario A: tau = 0.52, p = 0.002, n = 24
Strong upward trend, highly significant, adequate sample size. This is a clear result. You have statistical evidence of an increasing pattern.
Scenario B: tau = 0.12, p = 0.48, n = 18
Weak tau, not significant. But note the small sample size. You can't confidently conclude "no trend"—you might just lack power. If this is important, collect more data.
Scenario C: tau = 0.28, p = 0.03, n = 32
Moderate trend, statistically significant, good sample size. But tau = 0.28 means only about 64% of pairs show the pattern. It's real, but not dramatic. Consider practical significance alongside statistical significance.
Scenario D: tau = 0.61, p = 0.08, n = 10
Strong effect size but not quite significant, small sample. This screams "underpowered test." The trend might be real—you just don't have enough data to confirm it statistically. Collect more observations.
Practical vs. Statistical Significance
A statistically significant trend (p < 0.05) doesn't automatically mean it matters for your business. Tau = 0.15, p = 0.04 with n = 60 is statistically significant but represents a very weak pattern. Always ask: is this trend large enough to care about?
Sen's Slope: Quantifying the Trend Magnitude
Mann-Kendall tells you if there's a trend. Sen's slope estimator tells you how steep it is.
Sen's slope is the median of all pairwise slopes in your data. For each pair of points (xᵢ, xⱼ), calculate the slope: (xⱼ - xᵢ) / (tⱼ - tᵢ). Then take the median of all those slopes.
Why use the median instead of mean slope? Same reason Mann-Kendall uses ranks instead of raw values—robustness to outliers. One extreme data point won't skew the result.
Sen's slope has the same units as your data. If you're measuring monthly revenue in dollars, Sen's slope might be $2,300/month. That's directly interpretable: "Revenue increased by a median of $2,300 per month over this period."
In the revenue example from earlier (18 months, tau = 0.647, p = 0.00012), Sen's slope comes out to about $4,200/month. Combined with Mann-Kendall, you can now say: "Revenue showed a statistically significant upward trend (p < 0.001), increasing at a median rate of $4,200 per month."
Most statistical packages that offer Mann-Kendall also calculate Sen's slope automatically. Use them together for complete trend characterization.
What a Mann-Kendall Analysis Actually Looks Like
When you run a proper trend test, you shouldn't just get a p-value. Here's what a complete analysis includes:
1. Visual inspection
- Time series plot with the raw data
- Sen's slope line overlaid (showing the median trend)
- Confidence interval around the slope
2. Test statistics
- Kendall's tau with interpretation (e.g., "tau = 0.42 indicates 71% of pairs show increases")
- Two-tailed p-value
- Sample size and number of comparisons
- Adjustment for ties if present
3. Sen's slope estimate
- Point estimate (median slope)
- 95% confidence interval
- Units clearly labeled
4. Diagnostic checks
- Lag-1 autocorrelation coefficient
- Note if seasonal adjustment was applied
- Statement about test assumptions (independence, monotonic trend)
5. Practical interpretation
- Plain language conclusion ("We detected a statistically significant upward trend...")
- Effect size context (is tau = 0.3 meaningful for this application?)
- Any limitations or caveats (sample size, data quality issues)
This is what you should expect from any trend analysis tool—not just a p-value, but a complete picture of your data's behavior over time. The free trend test tool at MCP Analytics provides exactly this: upload your CSV with timestamped values, and you get back the full statistical workup with visualizations, test statistics, Sen's slope, and diagnostic information.
Variations: Seasonal and Regional Mann-Kendall
Seasonal Mann-Kendall
When your data has repeating seasonal patterns, the seasonal variant separates the trend from the cycle. Instead of comparing all observations, it compares each season only to the same season in other years.
For monthly data, it compares all Januaries to each other, all Februaries to each other, etc. Then it combines these season-specific trend tests into an overall statistic.
Example: Monthly retail sales naturally peak in November-December. Seasonal Mann-Kendall would test whether November 2024 > November 2023 > November 2022, whether December 2024 > December 2023 > December 2022, and so on. This reveals whether sales are trending up year-over-year, independent of the within-year seasonal cycle.
Use seasonal Mann-Kendall whenever you have:
- Monthly data with annual patterns
- Daily data with weekly patterns (weekday vs weekend)
- Hourly data with daily patterns (business hours vs off-hours)
Regional Mann-Kendall
This variant tests for trends across multiple related time series simultaneously. For example, if you're monitoring pollution levels at 15 different sites, regional Mann-Kendall tests whether there's a common trend across all sites while accounting for site-to-site differences.
It's less common in business analytics but useful when you have:
- Multiple stores/regions where you expect similar trends
- A/B test variants where you want to detect overall directional effects
- Product lines where you're testing for category-wide trends
Limitations You Need to Know
Mann-Kendall is robust and flexible, but it's not magic. Here are its real limitations:
1. It only detects monotonic trends
If your data goes up, then down, then up again (U-shaped or inverted U), Mann-Kendall will likely return "no significant trend" because the increases and decreases cancel out. It can't detect non-monotonic patterns.
If you suspect your trend changes direction, split your time series at the inflection point and test each segment separately, or use change-point detection methods.
2. It doesn't tell you anything about the future
Mann-Kendall is purely descriptive. It tells you what pattern existed in the observed data. It doesn't predict whether that pattern will continue. For forecasting, you need time series models (ARIMA, exponential smoothing, etc.).
3. It's sensitive to autocorrelation
As mentioned earlier, positive autocorrelation inflates the false positive rate. If consecutive observations are correlated (common in time series), you need to use a modified version or pre-whiten the data.
4. Short time series lack power
With fewer than 10-12 observations, you can only detect very strong trends. If you have limited data, report confidence intervals and acknowledge the uncertainty rather than treating p > 0.05 as definitive proof of no trend.
5. Outliers matter less than in regression, but they still matter
Mann-Kendall is more robust to outliers than linear regression, but extreme values can still affect results, especially with small samples. Always plot your data and investigate any obvious anomalies before testing.
Running the Test: Software and Implementation
You don't need to code this from scratch. Here's how to run Mann-Kendall in common platforms:
R
library(Kendall)
# Basic Mann-Kendall test
result <- MannKendall(your_time_series)
summary(result)
# With Sen's slope
library(trend)
mk.test(your_time_series)
sens.slope(your_time_series)
Python
import pymannkendall as mk
# Mann-Kendall test
result = mk.original_test(your_data)
print(result)
# Seasonal Mann-Kendall
result_seasonal = mk.seasonal_test(your_data, period=12)
Excel (manual calculation for small datasets)
Doable but tedious. You'd manually compare all pairs, sum the signs, then calculate the z-score. For anything beyond 10-15 observations, use statistical software instead.
No-code option
If you don't have R or Python installed and don't want to learn them just for this test, use a web-based analysis platform. Upload your CSV with a date/time column and a value column, select Mann-Kendall trend test, and get results instantly. This is particularly useful for one-off analyses or when you need to share results with non-technical stakeholders.
Reporting Your Results Correctly
Here's a template for reporting Mann-Kendall results in a way that's both statistically rigorous and understandable:
"We tested for monotonic trend in [variable] over [time period] using the Mann-Kendall test (n = [sample size]). The analysis revealed a [significant/non-significant] [upward/downward] trend (Kendall's tau = [value], p = [p-value], two-tailed). Sen's slope estimate indicates a median change of [slope value with units] per [time unit] (95% CI: [lower bound] to [upper bound])."
Example for the revenue data:
"We tested for monotonic trend in monthly revenue over 18 months (January 2025 – June 2026) using the Mann-Kendall test (n = 18). The analysis revealed a significant upward trend (Kendall's tau = 0.647, p < 0.001, two-tailed). Sen's slope estimate indicates a median increase of $4,200 per month (95% CI: $3,100 to $5,400)."
If the test was NOT significant:
"We did not detect a statistically significant trend in customer acquisition rate over Q2 2026 (Kendall's tau = 0.18, p = 0.24, n = 13). However, the limited sample size may reduce power to detect moderate trends. Continued monitoring is recommended."
Always include:
- The specific variable and time period tested
- Sample size (so readers can assess power)
- Both tau (effect size) and p-value (significance)
- Sen's slope with confidence interval (quantifies the trend)
- Any adjustments made (for autocorrelation, seasonality, etc.)
Real-World Applications
Business metrics monitoring
You're tracking monthly active users (MAU) and need to know if growth is real or just random fluctuation. Mann-Kendall gives you a statistical answer. If tau = 0.45, p = 0.008 over 20 months, you have evidence of genuine user growth.
Quality control and process monitoring
Manufacturing defect rates over time. Are defects trending upward (process degradation) or downward (improvements working)? Mann-Kendall can detect gradual changes before they become crises.
Website performance tracking
Page load times over the past 30 days. Is performance degrading? A significant downward trend (faster load times) confirms your optimization efforts are working. A significant upward trend means you have a problem.
Environmental and compliance monitoring
Pollution levels, water quality, emissions—any regulated metric measured over time. Mann-Kendall is standard in environmental statistics precisely because these datasets rarely meet regression assumptions.
Marketing campaign effectiveness
Weekly conversion rates since launching a new campaign. Is there an upward trend suggesting the campaign is working, or is week-to-week variation just noise? Test it instead of guessing.
When You Should (and Shouldn't) Trust the Results
Trust your Mann-Kendall results when:
- You have at least 15-20 observations (adequate power for moderate trends)
- You've checked for and addressed autocorrelation if present
- You've accounted for seasonality using the appropriate variant
- Your time window was defined a priori, not cherry-picked
- The trend is monotonic (one directional pattern, not up-then-down)
Be skeptical when:
- You have fewer than 12 observations (underpowered)
- You tested multiple time windows and only reported the significant one (p-hacking)
- Your data has obvious outliers you haven't investigated
- The trend visually appears to change direction mid-series
- You ignored seasonality in obviously seasonal data
- Someone reports only the p-value without tau or Sen's slope (hiding a weak effect)
The Replication Check
Here's a sanity check: if you split your time series in half and run Mann-Kendall on each half separately, do you get similar results? If the first half shows tau = 0.52 (p = 0.02) and the second half shows tau = -0.18 (p = 0.38), your "overall trend" is probably an artifact of non-monotonic behavior. Investigate further before trusting the combined result.
Frequently Asked Questions
What's the difference between Mann-Kendall and linear regression for trend detection?
Linear regression assumes your trend is a straight line and requires normally distributed residuals. Mann-Kendall only tests whether values tend to increase or decrease over time (monotonic trend) without assuming any specific shape. It's more robust to outliers and works with non-linear trends like exponential growth or saturation curves.
How many data points do I need for a Mann-Kendall test?
Technically, you can run it with as few as 4 observations, but you won't have enough statistical power to detect anything except massive trends. For meaningful results, aim for at least 12-15 points. With 20+ observations, you can detect moderate trends reliably. With 50+, you can pick up subtle changes.
Can Mann-Kendall handle missing data or irregular time intervals?
Missing data: Yes, with caveats. The test can handle gaps in your time series, but if data is missing systematically (only missing during high/low periods), you'll bias your results. Irregular intervals: The standard Mann-Kendall doesn't account for unequal spacing. If your measurements are irregularly spaced, consider time-weighted variants or ensure gaps are random.
What does a positive tau value mean in Mann-Kendall results?
Kendall's tau ranges from -1 to +1. Positive values indicate an upward trend, negative values indicate a downward trend. The magnitude tells you trend strength: tau near 0 means weak/no trend, tau near ±0.3 is moderate, tau above ±0.5 is strong. But always check the p-value—a strong tau with p > 0.05 still isn't statistically significant.
When should I use the seasonal Mann-Kendall test instead?
Use seasonal Mann-Kendall when your data has repeating patterns (monthly sales with holiday spikes, daily traffic with weekday/weekend cycles). The seasonal version compares each period only to the same period in other cycles (January 2024 vs January 2025), removing seasonal effects to reveal the underlying trend. If you run standard Mann-Kendall on seasonal data, you might miss real trends or find false ones.
The Bottom Line
Before you conclude that time series is trending, ask yourself: did I test that claim?
Visual patterns are suggestive, but they're not evidence. Human pattern recognition sees trends in random noise. The Mann-Kendall test gives you a statistical answer: is this directional pattern strong enough that it's unlikely to occur by chance?
Use it when:
- You need to know if a trend exists (not predict future values)
- Your trend might be non-linear
- You can't assume normality
- You have at least 12-15 observations
Avoid it when:
- You need forecasts or quantified rates of change (use regression or time series models)
- Your trend clearly changes direction mid-series (split the analysis)
- You have strong seasonality (use the seasonal variant)
- You have fewer than 10 points (wait for more data)
And always report three things together: Kendall's tau (effect size), p-value (significance), and sample size (context). A p-value alone is nearly useless.
Now go test your data properly. Upload your time series to the free Mann-Kendall trend test, get your tau statistic, p-value, and Sen's slope, and know whether that pattern you're seeing is real or just wishful thinking.