Thank you, Jack.
Here is what I mean:
I have time series (daily) data for about 50 portfolios. I want to calculate the mean over
time for each of the portfolios. And store them in below way:
portfolio 1 mean 1
portfolio 2 mean 2
portfolio 3 mean 3
...
I am able to get statics summary for all the portfolios. (That includes mean and std) How
to store these statics for each portfolio in a way convenient to further processing?
Thank you!
Regards,
Rebecca
--- On Fri, 11/7/08, Riccardo (Jack) Lucchetti <r.lucchetti(a)univpm.it> wrote:
From: Riccardo (Jack) Lucchetti <r.lucchetti(a)univpm.it>
Subject: Re: [Gretl-users] any documentation on error message
To: zzh5460(a)yahoo.com, "Gretl list" <gretl-users(a)lists.wfu.edu>
Date: Friday, November 7, 2008, 12:28 PM
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