function list high_freq_list (const matrix x, int compfac, string vname) list ret = deflist() scalar T = $nobs if rows(x) != compfac*T || cols(x) != 1 funcerr "Invalid x matrix" endif matrix m = mreverse(mshape(x, compfac, T))' loop i=1..compfac scalar k = compfac + 1 - i ret += genseries(sprintf("%s%d", vname, k), m[,i]) endloop setinfo ret --midas return ret end function # construct a little "quarterly" dataset nulldata 12 setobs 4 1980:1 # generate "monthly" data, 1,2,...,36 matrix x = seq(1,3*$nobs)' print x # turn into midas list list H = high_freq_list(x, 3, "test_m") print H --byobs