Survival & Time Series

Two specialised families: Survival for time-to-event data, and Time Series for data ordered in time.

Survival

Analyze → Survival. Survival data record the time until an event (death, relapse, failure), where some cases are censored — the event had not happened by the end of observation.

Both procedures use a status variable that marks the event, plus an event value that says which code means "event happened" (other values are treated as right-censored).

Weighting. Survival estimates (Kaplan-Meier and Cox) honour the Weight Cases setting: the case weight is a frequency weight, folded into the risk sets, the event and censoring counts and the Greenwood standard errors (Kaplan-Meier and the log-rank test), and into the partial likelihood (Cox).

Kaplan-Meier

When. Estimate and compare survival curves without assuming a model.

Dialog. A time variable, a status variable (and its event value), and an optional factor to compare groups.

Output. The survival table (survival probability with Greenwood standard errors at each event time), a case summary with restricted-mean and median survival, and — with a factor — a log-rank (Mantel-Cox) test comparing groups. A Plot… option draws the survival curve (or a cumulative-hazard curve); membership/survival can be saved.

Cox Regression

When. Model the hazard from one or more predictors (proportional-hazards regression).

Dialog. Time, status (+ event value), and the covariates. Options include tie handling (Efron by default, or Breslow), strata, a (start, stop] counting-process layout, a baseline survival table, and Test proportional hazards.

Output. Coefficients with standard errors and Wald tests, Exp(B) hazard ratios with confidence intervals, and the omnibus likelihood-ratio test. Baseline survival, martingale residuals and scaled Schoenfeld residuals can be saved.

Checking proportional hazards. Cox assumes each covariate's hazard ratio is constant over time. Tick Test proportional hazards to add the Grambsch-Therneau test: a Proportional Hazards Tests table with a global and a per-covariate χ², plus a scaled Schoenfeld residual vs. time scatter for each covariate. A small Sig. (or a clear trend in the plot rather than a flat band) is evidence the assumption is violated for that covariate — consider stratifying on it, adding a time interaction, or a (start, stop] layout. The time axis can be transformed by rank (default), identity or log.

Example. Model time-to-diagnosis by Age, BMI and SmokingStatus.

Time Series

Analyze → Time Series. For a variable whose cases are in time order. The series is taken as the non-missing values in case order.

Weighting. The series is analysed unweighted by design — a frequency weight replicates cases, which is undefined for a series taken in order (a duplicated observation has no place in the sequence). A weight variable still selects which cases are included; the output notes this when a weight is active.

Autocorrelation

When. Inspect the serial structure of a series before modelling it.

Dialog. The series variable; optional regular and seasonal differencing.

Output. The ACF (autocorrelation, with Bartlett standard errors and a cumulative Box-Ljung Q test) and the PACF (partial autocorrelation). A Plot… option draws the correlogram (stems with a ±1.96·SE band).

ARIMA / SARIMA

When. Fit a Box-Jenkins model and forecast.

Dialog. The series and the orders: regular (p, d, q) and, for seasonal data, (P, D, Q) with a period. Options choose the estimation method (conditional least squares or exact maximum likelihood), whether to choose orders automatically (by AIC or BIC), and how many forecast steps to produce.

Output. The model-parameters table (AR/MA terms with t-tests, residual variance, log-likelihood, AIC/BIC, a residual Box-Ljung test) titled with the fitted order, a model-selection table when auto-order is on, and — with a forecast — a forecast table plus a forecast Plot… (observed line, forecast line and a shaded prediction interval).

Stationarity Tests

When. Decide whether a series needs differencing before fitting ARIMA.

Dialog. The series and the deterministic terms (a constant, or a constant plus a linear trend).

Output. Two complementary tests, each with a statistic, a p-value and a 5% conclusion: the Augmented Dickey-Fuller test (null: a unit root — a small Sig. means the series is stationary) and the KPSS test (null: stationarity — a small Sig. means it is not). Agreement between them is reassuring; disagreement suggests a borderline or trend-stationary case. A * marks a KPSS statistic outside its lookup table, so that p is a bound.

Exponential Smoothing

When. A quick, robust forecast — the everyday alternative to ARIMA.

Dialog. The series, a trend (none → simple smoothing, or additiveHolt), a seasonal component (none, or additiveHolt-Winters, with a period), and the number of forecast steps.

Output. The fitted smoothing parameters (α level, β trend, γ season), a fit summary (SSE, residual variance, RMSE) and — with a forecast — the same forecast table and Plot… as ARIMA. The parameters are chosen by minimizing the one-step forecast error.

Seasonal Decomposition

When. Take a seasonal series apart — how much is long-run trend, how much repeats every period, and what is left over — as a descriptive first look, or before choosing between a seasonal ARIMA and Holt-Winters.

Dialog. The series; the seasonal period (e.g. 12 for monthly, 4 for quarterly; at least 2, and the series needs at least two full periods); and the modeladditive (observed = trend + seasonal + remainder) or multiplicative (trend × seasonal × remainder, for a series whose seasonal swing grows with its level; needs strictly positive values).

Output. The Seasonal Indices table — one row per season position, centred to sum 0 (additive) or to mean 1 (multiplicative) — and the Decomposition table in case order: t, Observed, Trend, Seasonal and Remainder. This is the classical method: the trend is a centred moving average of the period's length, each seasonal index the average detrended value at that position, and the remainder what the two leave; trend and remainder are blank where the moving-average window does not reach the ends of the series.

Cross-Correlation

When. Relate two series — does one lead the other, and by how many steps? The two-series counterpart of the autocorrelation function, and the usual first look before modelling the pair together (see VAR below).

Dialog. Series 1 (x), Series 2 (y), and an optional maximum lag (default 16, capped at n − 1). Both series are taken in case order over the cases where both values are present.

Output. The Cross-Correlations table: for every lag k from −max to +max, the correlation between x at time t and y at time t + k, with its white-noise standard error (1/√N — a correlation beyond about ±2 SE stands out; the ±1.96·SE band is the one the correlogram draws). Lag 0 is the ordinary Pearson correlation. A positive lag means series 2 leads series 1. As with the other time-series tools, a weight variable only selects cases; the output notes this when one is active.

Vector Autoregression & Granger Causality

When. Two or more series over time — model them together and test whether one's history improves the prediction of another. Its own page: VAR & Granger Causality.

How this is computed

This section names which method each procedure prints — the estimator, the statistic, its degrees of freedom, and the tie, missing-value and weight rules — and links the recorded convention that explains the choice. The full index is the convention inventory; every number here is validated against independent packages per the validation suite.

  • Kaplan–Meier — the product-limit estimate with Greenwood's standard error; the median is the first time S(t) ≤ ½; the log-rank test is Mantel–Cox with the hypergeometric variance (Kaplan–Meier).
  • Cox regression — the partial likelihood with Efron's tie approximation by default (Breslow on request; SPSS and SAS default to Breslow), Wald hazard-ratio intervals exp(B ± z·SE), Breslow's baseline hazard (Cox); the proportional-hazards test is the Grambsch–Therneau statistic in its 1994 simplified form — survival ≥ 3.0's cox.zph uses the exact form, recorded (PH test).
  • Parametric survival / Competing risks — AFT models by ML on log-time; the cumulative incidence function and Fine–Gray (validation).
  • Autocorrelation — the ACF with divisor n, Bartlett's cumulative SE, Box–Ljung on k df; the PACF by Durbin–Levinson (autocorrelation).
  • ARIMA / SARIMA — conditional least squares by default, exact ML (Kalman) on request, a constant for an undifferenced series (ARIMA · tolerances).
  • Stationarity — ADF and KPSS with Schwert's lag rule; ADF's p from MacKinnon (1994); KPSS with the Bartlett kernel (stationarity).
  • Exponential smoothing / Seasonal decomposition — simple smoothing starts at the first observation and minimizes the one-step SSE; trend and seasonal forms are unit-tested at fixed parameters; decomposition is the classical centred moving average (smoothing).
  • Cross-correlation — ±2/√N Bartlett bands. VAR / Granger — see that page.

See also

  • VAR & Granger Causality — the multi-series companion to the tools above.
  • Graphs — the correlogram, forecast and survival plots are also reachable as analysis-attached charts.