I'm struggling to grasp in a string all the values of a dicrete
variable. Any hint?
Things must look like this:
string col_title = ""
matrix val = values(groups)
loop i = 1..rows(val) --quiet
col_title += val(i) # of course, it doesn't work
col_title += " "
I'm computing some poverty measures on different subpopulation.
Before I reinvent the wheel, is there a function to produce a cross
tabulation output like this one (including the strings)?
/ Group1 Group2 Group3 Total
Measure1 ... .... ..... ....
Measure2 .... .... ..... ....
I did test the following script but I'm not satisfied with the output:
printf "1. Headcount index : %g\n, %g\n, %g\n",
printf "2. Poverty-gap : %g\n, %g\n, %g\n",
printf "3. Sq poverty-gap : %g\n, %g\n, %g\n",
printf "4. Mean income : %g\n, %g\n, %g\n",
I've been using the modtest --autocorr option to test for autocorrelation in
a VAR model. I set the sample 1985 01 - 2009 04 (100 observations). The
automatic test and the manually specified LM test calculation do not yield
the same result because the former (automatic) uses observations (for the m
lags) outside the sample while the latter (manual) stays within
the specified sample period. I am of the opinion that the latter is more
accurate because the sample is restricted for a priori reasons that would be
invalid in the automatic autocorrelation testing option. Thoughts?
Here's the output from the script:
Breusch-Godfrey test for autocorrelation up to order 4
OLS, using observations 1985:1-2009:4 (T = 100)
Dependent variable: uhat
coefficient std. error t-ratio p-value
const -0.00580334 0.320830 -0.01809 0.9856
time -4.86302e-07 0.000692273 -0.0007025 0.9994
l_USGDP_1 -0.348853 0.657432 -0.5306 0.5970
l_USGDP_2 0.627695 0.609177 1.030 0.3057
l_USGDP_3 -0.123856 0.568652 -0.2178 0.8281
l_USGDP_4 -0.154690 0.333191 -0.4643 0.6436
l_COMP_1 0.00101458 0.0120923 0.08390 0.9333
l_COMP_2 -0.00117663 0.0211498 -0.05563 0.9558
l_COMP_3 -0.0101049 0.0314406 -0.3214 0.7487
l_COMP_4 0.0113482 0.0192114 0.5907 0.5563
uhat_1 0.377927 0.669859 0.5642 0.5741
uhat_2 -0.255529 0.496828 -0.5143 0.6083
uhat_3 -0.127548 0.238803 -0.5341 0.5946
uhat_4 -0.0859906 0.212572 -0.4045 0.6868
Unadjusted R-squared = 0.027148
Test statistic: LMF = 0.599973,
with p-value = P(F(4,86) > 0.599973) = 0.664
*Alternative statistic: TR^2 = 2.714813,*
*with p-value = P(Chi-square(4) > 2.71481) = 0.607*
Ljung-Box Q' = 0.955537,
with p-value = P(Chi-square(4) > 0.955537) = 0.916
Model 2: OLS, using observations 1986:1-2009:4 (T = 96)
Dependent variable: uhatUSGDP
coefficient std. error t-ratio p-value
const -0.0211644 0.397158 -0.05329 0.9576
uhatUSGDP_1 0.338611 0.910909 0.3717 0.7111
uhatUSGDP_2 -0.261190 0.584142 -0.4471 0.6560
uhatUSGDP_3 -0.149634 0.245107 -0.6105 0.5432
uhatUSGDP_4 -0.0877872 0.221146 -0.3970 0.6924
time -3.10909e-05 0.000855037 -0.03636 0.9711
l_USGDP_1 -0.309372 0.900280 -0.3436 0.7320
l_USGDP_2 0.580976 0.772587 0.7520 0.4542
l_USGDP_3 -0.107547 0.720912 -0.1492 0.8818
l_USGDP_4 -0.159781 0.485321 -0.3292 0.7428
l_COMP_1 0.00192274 0.0123714 0.1554 0.8769
l_COMP_2 -0.00188331 0.0216852 -0.08685 0.9310
l_COMP_3 -0.0100372 0.0391818 -0.2562 0.7985
l_COMP_4 0.0116237 0.0259833 0.4474 0.6558
Mean dependent var -0.000048 S.D. dependent var 0.004580
Sum squared resid 0.001943 S.E. of regression 0.004868
R-squared 0.024783 Adjusted R-squared -0.129825
F(13, 82) 0.160296 P-value(F) 0.999620
Log-likelihood 382.5531 Akaike criterion -737.1062
Schwarz criterion -701.2053 Hannan-Quinn -722.5945
rho -0.001343 Durbin-Watson 1.998754
Excluding the constant, p-value was highest for variable 52 (time)
Generated scalar T = 96
Generated scalar R = 0.024783
Generated scalar LM = 2.37917
Chi-square(4): area to the right of 2.37917 = 0.666394
(to the left: 0.333606)
I'm doing some calculation for the gini index and I noticed some small
differences between the gretl's built-in command and the step-by-step
calculation on P and L. Any suggestion?
without (0,0) 0,414005424*256711*
including (0,0) 0,414005424*164925*
Hello everyone! Can somebody help me?
I would like to ask a couple of things about gretl software:
1. Does it support GPU acceleration?
2. Does it support distributed networking? (running the same program in parallel computing to speed up the process.)
Your answer is highly appreciated.
Thank you very much,
After a long correspondence with a user who saw gretl crashing
on start-up on OS X Lion, it became apparent that the GTK
(2.14.3) framework we've been using (built by the R guys) may
be problematic on Lion. When he tried with a different GTK
version, gretl ran OK.
The alternative build he tried at my suggestion was another
from the R guys, namely GTK_2.18.5-X11.pkg. This is more or
less a drop-in replacement for the version we've been using,
but it requires a little hackery to get gretl working with it,
and in my experience on OS X 10.6.8 the font-handling is
So... I've now built a new GTK+.framework myself, on 10.6.8.
This one should be a direct drop-in replacement for the
framework we've been using up till now -- on intel macs
running OS X 10.6 or higher. And the font handling should be
I'd be grateful if people could test this build. To give it a
try, do the following (but please read to the end first!):
double-click to unzip it. (You can then delete the .gz file.)
2) Move your existing GTK+.framework out of the way: in a
sudo mv /Library/Frameworks/GTK+.framework \
3) Double-click the new dmg file to mount it, then open the
image in the Finder. Drag the GTK+.framework folder onto the
Frameworks folder to install.
Now check that gretl runs OK. Although it's not essential, you
may want to use the current gretl snapshot:
Since the problem that started all this was on Lion, I'm
particularly interested to see if gretl works there with this
new GTK build, but I'm also interested in results on 10.6.
Note: at present this is a single-arch build, only i386. If
you're running GTK apps other than gretl, and some of them are
64-bit, this framework will NOT support them. I can add x86_64
if need be.
If you try the new framework and then want to restore the old
# delete the new one
sudo rm -rf /Library/Frameworks/GTK+.framework
# restore the old
sudo mv /Library/Frameworks/GTK+.framework.old \
Is anyone using current gretl on OS X 10.7? I've had a report
today that gretl crashes on start-up, and I don't know if this
is a generic problem or a misconfiguration issue. I'm
appending the correspondence I've had on this point
(backwards, I'm afraid).
Date: Mon, 3 Oct 2011 19:31:59 +0100
From: Abhijit Sharma <sharmaabhijit(a)gmail.com>
To: Allin Cottrell <cottrell(a)wfu.edu>
Subject: Re: Gretl 1.9.5 on Mac OSX 10.7 Lion
Thanks for your response. I have tried a number of things
including installing the current gretl snapshot but the
Segmentation fault: 11 message seems to persist.
Thanks in advance but it seems that something is stopping
Gretl from launching - x11 launches gretl tries to start but
then it aborts.
On 3 Oct 2011, at 14:01, Allin Cottrell wrote:
> On Mon, 3 Oct 2011, Abhijit Sharma wrote:
>> I am a great fan and supporter of your excellent
>> econometrics software, Gretl, which I recommend to both UG
>> and PG students at the Bradford University School of
> Glad you like it!
>> I am writing to you with a quick query. I have recently
>> upgraded to Mac OSX Lion (10.7). Unfortunately Gretl 1.9.5
>> does not seem to work any more. X11 is invoked and Gretl
>> launches and then it soon crashes. Since my students use
>> Gretl it is important for me to have a irking copy as well.
>> Following your instructions I typed the following in
>> Terminal and got this output:
>> Macintosh-8:bin abhijitsharma$ cd /Applications/Gretl.app/Contents/Resources/bin
>> Macintosh-8:bin abhijitsharma$ ./gretl
>> Couldn't read /Users/abhijitsharma/.gretl2rc
>> Segmentation fault: 11
> Hmm, the "Couldn't read /Users/abhijitsharma/.gretl2rc"
> shouldn't be a problem on a first-time launch of gretl. But
> the segmentation fault obviously is a problem. Could you try
> the current gretl snapshot (i.e. the file gretl-intel.dmg.gz
> at http://gretl.sourceforge.net/osx.html ) and see if that
> build has the same problem?
> The snapshot is close to being gretl 1.9.6, which we plan to
> release shortly.
> Allin Cottrell
I'm calculating the Gini index on a very huge dataset.
While in the command line the operation hardly takes a couple of
seconds, through the GUI (Variable -> Gini coeff) it lasts quite long
and gretl crashes with the following message error. Well, maybe that's a
gnuplot issue I guess!
Reading Allin Cottrells thougtfull paper on extending Gretl and the
importance of the Bundle-Type as Return-Type of functions I noticed how
powerful and similar it is to the Matlab Econometric Toolbox of LeSage
and Grocer, the Econometric Toolbox for Scilab. Since the Syntax for
Function Definition is so similar, it should be easy to translate some
useful and missing functions to Gretl (the code of the Toolboxes is open
and well documented); e.g Grocer entails a function automatic, which
does the general to specific Model Selection of Hendry and Krozlig, only
implemented in PCGets. Well, that is my question for the Developers and
the Gretl-Community: What is useful and/or important, but still missing?
What features should Gretl 2.0 have?
My own wishes and ideas cover broadly two things I miss.
The first, and more important one, concerns what in Gretl is called
system and in Eviews Model. After estimating the system it should be
possible to solve it, make dynamic and stochastic simulations and
forecasts, calculate multipliers, simulate and analyze scenarios etc. I
am not sure, but it seems that one cannot do that in Gretl so far? The
chapter on that in the UserGuide is unwritten. Eviews offers Dialogs for
many options. Ray Fairs Fortran Program Fair-Parke has several more
options (forecast evaluation, optimal control etc), and Fair makes the
source available on his Website (but I cant read Fortran77, anybody out
there?). I think that if Gretl would have such standard and advanced
routines and expose it in the usual user-friendly and nice way, it
would be great (and offer some competitive advantage over EViews).
The second thing I miss is a Database search and query possibility (also
offered by EViews), that is searching and selecting data by some set of
criteria, e.g. Us GDP annual, in current or chained dollar since 1970,
published by BEA. My idea how to implement this is roughly the
following. That criteria arent too many and always roughly the same,
i.e. country, variable, frequency, start-enddate, unit, datasource and
maybe some more. Therefore it would be possible to set up a relational
Database according to a Star Scheme with Dimension Tables for country,
unit etc, so that the complete Information for a Series is given by the
specific combination of entries in the Dimension Tables. Now, for the
Gretl Databases the idx Files already contain most of the Information to
populate the Dimension Tables, so maybe they can be read in in bulk,
adding a few Informations manually. A small Database is SQLite, which
could be easily added since its one sqlite.c file. Then the queries with
sql select combinations could be built and connected to a Gui with e.g.
Comboboxes for each Dimension for selection. Well, does that idea make
Well, too much for a first statement...but anyway, Gretl is a wonderfull
program and I want to thank Allin for it.
Hello gretl community,
Since a while I receive an error when I try to compile the daily cvs on
my ubuntu (11.04) machine. Actually, it seems to be an error with latex
since no pdf-file is produced. I attached the "gretl-guide-a4.log"-file.