On Fri, 4 Jul 2008, Davoud Taghawi-Nejad wrote:
I have a dataset, which I would like to compact form 10 to 1. In
other
words, there are 10 measurements a year. But I would like to average the
10 obs int 1. I try the following:?
? setobs 10 1:01
Full data range: 1:01 - 50:10 (n = 500)
? dataset compact 1
This command won't work with the current periodicity.
That's right: frequency 10 is not supported for compaction. You
can, however, compact data of arbitrary frequency using matrix
methods. The following script creates a frequency-10 dataset,
adds a random variable, and converts to frequency 1 by averaging:
nulldata 50
setobs 10 1.1 --special
genr x = normal()
matrix X = x
matrix Z = meanc(mshape(X,10,5))'
Z
nulldata 5 --preserve
setobs 1 1970 --time-series
series compx = Z
print compx --byobs
Allin Cottrell