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
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