Is there any tool to test the tendency toward/away from stationarity? I have time series data, like the following:
Time       Value
   1          20
   3          40
   8         -10
   9          30
       ...

I'm wondering if there is any test if this time series is toward 0 (like "decrescendo" pattern in the traceplot), or away from 0 (like "crescendo" pattern in the traceplot).
Any recommendation for the tool to visualize/summarize this pattern will be appreciated.
 A: There are many such tests.
Generally, they fall into two categories:


*

*Tests for unit root (I.e. tests of stationarity)
$H_{0}:$ Time series is/are stationary.
$H_{A}:$ Time series has/have unit root (i.e. is non-stationary).
Example: The Hadri-Lagrange multiplier test.

*Tests for stationarity (I.e. tests of unit root)
$H_{0}:$ Time series has/have unit root.
$H_{A}:$ Time series is/are stationary.
Example: The Im-Pesaran-Shim test.
There are many versions of these tests, for example, for making such inferences about multiple time series (e.g., a time series for each country, city, etc.). Which tests are appropriate for you depends on your study design (e.g., single or multiple time series, balanced measurements, missing observations, etc.).
I think a wise way to approach making use of such tests is to combine inference from an appropriate version of a test for stationarity, coupled with an appropriate version of a test for unit root:


*

*Reject test for stationarity, and fail to reject test for unit root: conclude data are stationary.

*Fail to reject test for stationarity, and reject test for unit root: conclude data have unit root (are non-stationary).

*Fail to reject test for stationarity, and fail to reject test for unit root: conclude data are under-powered to make any inference one way or the other.

*Reject test for stationarity, and reject test for unit root: think hard about your data! For example with tests like those I mentioned above it may be the case that some time series have unit root, and some time series are stationary. It may also be the case that your data are autoregressive (values have memory of their prior states), but are not fully unit root (i.e. the memory decays eventually, instead of carrying forward infinitely).
For a single time series, the augmented Dickey-Fuller test for stationarity, and the complementary Kwiatkowski–Phillips–Schmidt–Shin test for unit root may be appropriate tools, and these tests are commonly implemented in statistical software (e.g., R, Stata, etc.).
Further, explicit modeling of autoregressive process will allow you to make inferences not only about stationarity vs. unit root, but the middle-ground of autoregressive (memoried) processes, which will be stationary in the long run (possibly very long run), but still present difficulties for valid inference over shorter time scales. For example, using OLS regression or some other estimator, one could model the first difference of a time series ($\Delta y_{t} = y_{t} - y_{t-1}$) using a single lag:
$$\Delta y_{t} = \alpha + \rho y_{t-1} + \zeta_{t}$$
A value of $\rho$ which is undifferentiable from $0$ (equivalence tests can help with this inference) is evidence of stationarity (trend stationarity if $\alpha \ne 0$) over the time scale of your data. A value of $|\rho| \approx 1$ is evidence of unit root. A value of $0 < \rho < 1$ is an autoregressive process which is likely to demand an appropriate time series model (see de Boef and Keele) the closer $\rho$ is to 1 (i.e. the longer its memory gets). (There can even be $|\rho|>1$, implying a runaway process... in my discipline, I don't see these much.) Of course, models with more lags are also possible.
References
De Boef, S. (2001). Modeling equilibrium relationships: Error correction models with strongly autoregressive data. Political Analysis, 9(1):78–94.
De Boef, S. and Keele, L. (2008). Taking time seriously. American Journal of Political Science, 52(1):184–200.
Dickey, D. A. and 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.
Hadri, K. (2000). Testing for stationarity in heterogeneous panel data. The Econometrics Journal, 3(2):148–161.
Im, K. S., Pesaran, M. H., and Shin, Y. (2003). Testing for unit roots in heterogeneous panels. Journal of Econometrics, 115:53–74.
Kwiatkowski, D., Phillips, P. C., Schmidt, P., and Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root: how sure are we that economic time series have a unit root? Journal of Econometrics, 54(1-3):159–178.
A: You can plot the time-series and inspect it visually. A stationary time-series will have constant variance and have a constant expected value (edit to incorporate @Richard Hardy's comment). plot(Value~Time)
You could look at the ACF and PACF plots. They should die down if the series is stationary.
There is also the Augmented Dickey-Fuller Test for being stationary. In R use ?adf.test for more information.
