Trend tests and slope estimators answer different questions: the former assess statistical evidence for change, while the latter quantify its magnitude and rate over time.
Having established whether a trend exists in the previous vignette,
this one turns to the second question: how large is it?
slope_estimator() answers that question directly,
independently of whether the trend reached statistical significance.
slope_estimator() doesTrend magnitude describes how rapidly a variable changes over time.
In sptrends, it is quantified through slope estimation and
expressed in the units of the input variable per unit of time.
slope_estimator() estimates one temporal slope for each
valid raster cell and returns a raster representing the rate of change
across the study area. Theil-Sen (TS) (Theil, 1950; Sen, 1968) is
the default and generally recommended estimator because it provides a
robust balance between computational efficiency and resistance to
outliers.
The example below applies the recommended Theil-Sen estimator to the complete annual NDVI raster series at its original spatial resolution. The map shows raw slope estimates without filtering by statistical significance.
years <- 1982:2023
ts <- slope_estimator(
r, method = "TS", t = years,
report = FALSE, verbose = FALSE
)
plot(ts)Positive values indicate increasing trends, whereas negative values
indicate decreasing trends. A slope of 0.02 represents a
rate of change of 0.02 input units per unit of time. Unless the original
variable is expressed as a percentage, slope values should not be
interpreted as percentages. A slope represents a rate of change, not the
total change over the complete study period.
Slope estimation is particularly useful as a complement to CMK: CMK evaluates the statistical evidence for a spatially contextual trend, whereas the slope quantifies its magnitude. However, CMK does not correct serial correlation internally, so temporal dependence should be diagnosed and treated when necessary before inference. The raw slope map should not be interpreted as a map of statistically significant trends; significance and multiple testing must be evaluated separately.
| Method | Robustness | Relative computational cost | Guidance |
|---|---|---|---|
OLS |
Low | Low | Use when assumptions and efficiency justify it |
TS (Theil, 1950; Sen,
1968) |
High | Moderate | Recommended general-purpose choice |
RM (Siegel, 1982) |
Very high | High | Use when extreme contamination is plausible |
OLS is fastest but sensitive to outliers. Theil-Sen (TS)
usually provides the best balance between robustness and computation.
Siegel’s repeated median (RM) is more resistant but
substantially slower.
Continue to vignette("e-fdr-correction") to decide which
trend-test results remain reliable after testing many cells.
See ?slope_estimator for formulas, assumptions,
computational costs, robustness, optional smoothing, validation and
complete references.