Skip to contents

Internal NAs can cause trouble for time series operations such as X-13-ARIMA SEATS seasonal adjustment. Often, internal NAs only occur at at the beginning of a time series. Thus an easy solution to the problem is to discard the initial part of the data which contains the NA values. This way only a small part of the information is lost as opposed to not being able to seasonally adjust an entire series.

Usage

start_ts_after_internal_nas(series)

Arguments

series

on object of class ts

Examples

ts1 <- 1:30
ts1[c(3, 6)] <- NA
ts1 <- ts(ts1, start = c(2000, 1), frequency = 4)
start_ts_after_internal_nas(ts1)
#>      Qtr1 Qtr2 Qtr3 Qtr4
#> 2001              7    8
#> 2002    9   10   11   12
#> 2003   13   14   15   16
#> 2004   17   18   19   20
#> 2005   21   22   23   24
#> 2006   25   26   27   28
#> 2007   29   30