On Fri, 11 Apr 2014, Ignacio Diaz-Emparanza wrote:
On 10/04/14 16:14, valentina colombo wrote:
> Dera gretl users,
> I had estimate my SVAR model and I need to export the estimated
> coefficients (bootdata) to excel or csv file. I have tried to use the
> following command but it is storing my variables but not bootdata (from a
> SVAR).
> store /home/valentina/bootdata.csv bootdata
> ! gnumeric /home/valentina/bootdata.csv
> Any suggestion? I cannot go on with my estimation!!
> Thanks
> Valentina
>
For this type of things I use a combination of 'outfile' and 'printf'
commands. An example is below. The lines from 'open' to 'var' command are
taken from gretl example sw_ch14.in. The result is the file
"coefficients.csv" in your current gretl working directory.
<hansl>
open sw_ch14.gdt
# set the robust std errors variant used by S and W
set force_hc on
set hc_version 1
genr infl = 400 * log(PUNEW/PUNEW(-1))
diff infl
lags d_infl LHUR
smpl 1962:1 1999:4
# run "automatic" VAR, (see equations 14.5 and 14.6) in Stock and Watson,
# "Introduction to Econometrics", chapter 14
var 4 d_infl LHUR const -r
##########
set messages off
set echo off
matrix B=$coeff
scalar ncoefs=rows(B)
outfile coefficients.csv --write
loop i=1..ncoefs --quiet
printf "%.4f, %.4f\n ", B[i,1], B[i,2]
endloop
outfile --close
</hansl>
Also: don't be fooled by file extensions. If you use the "mwrite" command,
like Sven suggested, you'll obtain a text file that you can conveniently
open either in your favourite text editor or in any spreadheet worth
considering.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------