On Fri, 7 Nov 2008, Rebecca Zhang wrote:
I have time series data for 50 variables. I want to calculated
the mean for each variable and store the data as a cross-section
dataset that has two columns: one for 50 means and one for their
correpeponding varibles.
Sorry, I don't understand: the first (new) column is to contain 50
means, but what is the second column to contain?
You can create a series that contains the means of the variables
in the current dataset (provided the number of variables is not
greater than the number of observations) using something like:
list L = dataset
series means = 0
loop foreach i L
means[i] = mean($i)
endloop
--
Allin Cottrell
Department of Economics
Wake Forest University