Skip to contents

Standardizes user-supplied regressors before they are passed to X-13. The helper checks frequency, windows the regressor to the span of y, and returns NULL if the result cannot be aligned exactly.

Usage

sa_align_regressor(y, x)

Arguments

y

Target series, coercible to ts.

x

Regressor series, coercible to ts.

Value

A ts object aligned to y, or NULL when alignment fails.

Examples

y <- AirPassengers
x <- stats::lag(y, -1)
aligned <- sa_align_regressor(y, x)
#> Warning: 'start' value not changed
stats::frequency(aligned)
#> [1] 1