I was trying to use the following code to seasonally adjusted quarterly frequency data,
in the excel file "Q.xlsx", in the first column, i have the "Date", i have them format like
3/1/1992
6/1/1992
9/1/1992
12/1/1992
3/1/1993
6/1/1993
9/1/1993
12/1/1993
however, i got the following error message
"Error in x13_prepare(list = list, na.action = na.action, iofile = iofile) :
xreg and x must be of the same frequency."
what format of Date i should use in the excelsheet to read quarterly data into R ? thanks!
#read excel to data frame
df <- read_excel("Q.xlsx")
df
#read time series and SA
ts <- read.zoo(df)
ts <- as.ts(aggregate(ts, as.yearqtr, sum)) #aggregate to monthly, use as.yearqtr if quarterly
sa <- seas(
x = ts,
xreg = genhol(cny, start = 0, end = 0, center = "calendar"),
regression.aictest = "td",
regression.usertype = "holiday"
)
sad <- final(sa)
sad