I am using the R seasonal
package for seasonal adjustment. By default this will generate an X13 spec file with a fairly wide range of default options, as shown below. I would like to understand the arguments I would need to pass to the seas()
function so that only the series{}
block and x11 { save = (d11) }
get written into the spec file. as shown in the "desired spec file" example below.
library(seasonal)
x <- ts(rnorm(200), start=c(2000,1), frequency=12)
seas(x, x11="", dir="C:\logdir")
Spec file
series{
title = "iofile"
file = "C:\Users\USERNAME\AppData\Local\Temp\1\RtmpWIQp46\x132cdc34fb21e3/iofile.dta"
format = "datevalue"
period = 12
}
transform{
function = auto
print = aictransform
}
regression{
aictest = (td easter)
}
outlier{
}
automdl{
print = bestfivemdl
}
x11{
save = (d10 d11 d12 d13 d16 e18)
}
estimate{
save = (model estimates residuals)
}
spectrum{
print = qs
}
Desired spec file
series{
title = "iofile"
file = "C:\Users\USERNAME\AppData\Local\Temp\1\RtmpWIQp46\x132cdc34fb21e3/iofile.dta"
format = "datevalue"
period = 12
}
x11{
save = (d11)
}
The tables d10
, d11
, d12
, d13
, d16
, and e18
are added by default and cannot be removed because they are used by other functions in the package.
To add additional tables, use:
seas(AirPassengers, x11.save = "d5")
The standard way of retrieving additional data is through the series
function. This will re-evaluate the model one more time:
m <- seas(AirPassengers, x11 = list())
series(m, "d5")