'What causes R's "seasonal" package/function to not return an adjusted series?
I'm trying to get a seasonally adjusted version of two similar-looking series. The seas function works for the first and seems to silently fail to return data for the second. What's going on with this second series?
library(seasonal)
ts1 = structure(c(151, 162, 244, 184, 226, 244, 196, 199, 196, 150,
158, 90, 163, 157, 226, 243, 251, 260, 211, 261, 190, 189, 154,
111, 255, 166, 223, 231, 306, 303, 268, 256, 189, 202, 145, 105,
222, 201, 232, 177, 239, 256, 285, 222, 216, 219, 190, 162, 232,
180, 256, 293, 280, 283, 239, 248, 242, 205, 164, 136, 153, 136,
182, 217), .Tsp = c(2017, 2022.25, 12), class = "ts")
ts2 = structure(c(102, 125, 166, 151, 203, 183, 174, 174, 166, 155,
152, 124, 108, 108, 129, 175, 243, 206, 181, 210, 135, 152, 152,
132, 98, 113, 182, 184, 228, 179, 190, 190, 157, 157, 133, 141,
127, 183, 176, 156, 100, 207, 255, 230, 202, 213, 169, 180, 153,
145, 186, 221, 238, 286, 227, 213, 229, 193, 211, 214, 158, 163,
143, 184), .Tsp = c(2017, 2022.25, 12), class = "ts")
ts1
ts2
final(seas(ts1))
final(seas(ts2))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
