On Fri, 7 Nov 2008, Rebecca Zhang wrote:
Thank you, Allin.
I have a further question.
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.
Could you tell me how to do that in gretl? Thank you!
Is this what you mean?
<script>
set echo off
set messages off
nulldata 50
a = normal()
b = normal()
c = normal()
list X = a b c
outfile @dotdir/foo.csv --write
printf ",mean\n"
loop foreach i X -q
printf "$i,%12.5f\n", mean($i)
end loop
outfile @dotdir/foo.csv --close
open @dotdir/foo.csv
</script>
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti