### ### Example 6: comparison with the tempdisagg package for R ### on the "swisspharma" dataset ### set verbose off clear # run tempdisagg to prepare the data and provide a comparison foreign language=R --quiet library(tempdisagg) data(swisspharma) exports <- ts(exports.q, start=c(1975,1), end=c(2010,4), frequency=4) m0 <- td(sales.a ~ 0, to=4, method="denton-cholette") m1 <- td(sales.a ~ 0 + exports, to=4, method="denton-cholette") m2 <- td(sales.a ~ 1 + exports, to=4, method="chow-lin-maxlog") m3 <- td(sales.a ~ 1 + exports, to=4, method="chow-lin-minrss-quilis") x0 <- predict(m0) x1 <- predict(m1) x2 <- predict(m2) x3 <- predict(m3) x <- matrix(c(exports,x0,x1,x2,x3), nrow = 144) gretl.export(x) salesa <- as.matrix(sales.a) gretl.export(salesa) end foreign # set up a gretl dataset and import the data from R nulldata 144 setobs 4 1975:1 X = mread("x.mat", 1) salesa = mread("salesa.mat", 1) series exports = X[,1] bundle OPTIONS = _(aggtype="sum") OPTIONS.method = "denton-pfd" series z0 = tdisagg(salesa, , 4, OPTIONS) series x0 = X[,2] series z1 = tdisagg(salesa, exports, 4, OPTIONS) series x1 = X[,3] OPTIONS.method = "chow-lin-mle" series z2 = tdisagg(salesa, exports, 4, OPTIONS) series x2 = X[,4] OPTIONS.method = "chow-lin-ssr" series z3 = tdisagg(salesa, exports, 4, OPTIONS) series x3 = X[,5] # check that the results are (numerically) the same ols z0 const x0 --simple ols z1 const x1 --simple ols z2 const x2 --simple ols z3 const x3 --simple