panel data issues
by Sven Schreiber
Hello all panel-interested people,
while using gretl for teaching with panel data (which I hadn't done much
before) I noticed the following, let's say, interface nuisances compared
to the usual luxury gretl offers for time series:
1: The sample and/or range in the main window (bottom) are given as pure
index numbers, even if "panel data marker strings" (cf. user guide p.23)
are defined. At least for the time dimension it would be useful to show
the sample periods in a human-readable form (through the markers). Also,
I noticed that the period numbers shown do not always coincide with the
values of the "time" index variable, if subsampling is in effect. (Seen
in the CEL.gdt dataset after applying the sample restriction year>1970
for example.)
1b: A slightly more general suggestion, also for non-panel data: The
active sample restriction criterion could be shown next to the resulting
active sample in the main window. (At least for simple restrictions,
maybe not for complex, multiple ones.)
2: Menu Sample -> Set range: Only the group range can be chosen, not the
periods. Actually, given the often arbitrary ordering of groups, this is
really the less useful dimension to choose a contiguous range from. (I
know I can use "set sample based on criterion" for periods, but that's
not the point.)
3: About pshrink(): A version that returns a full panel series (with
repeated values like pmean() etc.) could be useful -- practical example:
in growth regressions one needs the initial value of output-per-worker
as a regressor. Also maybe it should be called "pfirst()" or something
instead.
4: Time-constant variables: I'm not sure how to create variables that
only vary along the cross-section, like it is done with the built-in
pmean() etc. functions. Or how to append them (like the user guide p.114
"adding a time series", but along the other panel dimension).
5: Constant in a fixed-effects regression: I don't understand what gretl
reports as the global constant term in a fixed-effects model, and it
doesn't seem to be defined in the guide. It's also confusing that gretl
complains if one wants to discard the constant in the specification
dialog (when fixed effects are selected). (But obviously gretl
estimates the right thing as the comparison with explicit LSDV
regression shows, just the constant is mysterious -- even if it's the
average of the fixed effects it's not clear where the standard errors
come from.)
6: Lags not showing in model spec dialog when sample is restricted to a
single period: If I restrict the CEL.gdt data with year==1985, I cannot
include any previously created lags (of y for example) in the
regression, because they don't show up in the variable selector. Because
the subsampled dataset is now treated as "undated", there's also no
"lags..." button in the dialog. -- Actually I don't understand why gretl
"temporarily forgets" the panel structure of the dataset when a single
period is active. It would seem less problematic to treat even a T=1
sample as a special case of panel data if the underlying dataset has a
panel structure; especially in conjunction with point 1 above about
showing the selected periods in the sample.
Ok, that was a long post, sorry, but still necessary I think.
Cheers,
Sven
10 years, 5 months
join filter and >=
by Sven Schreiber
This is a placeholder/reminder that I think it happens to me that I use
'join' with a filter of the form --filter="varname >= value" but the
operation sometimes seems to apply the condition '>' instead of '>=".
I don't have time right now, but I will try to produce a minimal example
later.
thanks,
sven
11 years, 2 months
Small bug in fcast
by Marcin Błażejowski
Hi,
simple code:
<hansl>
set echo off
set messages off
open bjg
smpl 1949:01 1960:08
Model <- ols g const g(-1) --simple
fcast --dynamic --out-of-sample
</hansl>
All works fine, but if we now open the Model in GUI and type "Analysis
-> Forecasts...' we get error: "command 'fcasterr' not recognized".
All the Best,
Marcin
--
Marcin Błażejowski
GG: 203127
11 years, 2 months
C-like string-handling in hansl
by Allin Cottrell
For some time now hansl has had three string-handling commands that
are C-like in their syntax, namely printf, sprintf and sscanf. As we
move towards gretl 2.0 (not immediately imminent; I expect at least
a couple more 1.9.N releases first), I'd like to rationalize these.
At present printf and sprintf are available in command form only,
while sscanf has been both a command and a function for over two
years, with the command being deprecated in favour of the function
since gretl 1.9.4 (2011-02-24). In today's CVS I finally removed the
sscanf command so that only the function remains.
First I'll say what I'd like to do, then I'll offer a rationale.
Proposal: Make both print and sprintf into functions, deprecate the
commands of the same name, and eventually (by 2.0) remove the
commands.
Reasoning: Considered as gretl commands, printf and sprintf are
anomalous, they don't have a structure similar to other commands.
Considered as functions, however, they are not anomalous. And if
they were implemented as functions they would be more efficient (run
faster) and we could remove some ad hoc code that's required to
support them as commands.
Suppose we did this. From the script-writer's point of view printf
would be very little changed. Instead of
printf "x = %g\n", x
you'd write
printf("x = %g\n", x)
(putting in the parentheses; wearing your seat-belt!).
What about sprintf? In this case I think we could usefully change
the structure a little. I would favour
string s = sprintf(format, args)
where the function returns the string created by the substitution of
the arguments ("args") into the format. Since this departs from the
signature of the C function of the same name one could make a case
for renaming the function in hansl ("strbuild" or some such), though
I'm not particularly recommending that.
Related: if printf were to become a function in hansl, what if
anything should it return? The C function returns the number of
characters printed. We could probably arrange that if anyone thinks
it's useful, otherwise it could return 0 on success, non-zero if
anything went wrong, or it could be a "void" function that doesn't
give a return value.
Allin Cottrell
11 years, 3 months
some minor things
by Sven Schreiber
Hi all,
the following questions have come up:
1) This doesn't work:
<hansl>
if {1} == {}
endif
</hansl>
Actually I can understand why, just checking if it's intended.
2) But this also doesn't work (with suitably defined variables):
dummy = sscanf( strsub(isodate(newepochdate),"-",""), "%d", newdate )
while the non-nested variant does work:
<hansl>
tempstr = strsub(isodate(newepochdate),"-","")
dummy = sscanf( tempstr, "%d", newdate )
</hansl>
Here I don't see why there should be a difference -- it rather looks as
if the earlier bug with string-producing functions hasn't been fully
squashed.
thanks,
sven
11 years, 3 months
'set' string problem
by Sven Schreiber
Hi,
I noticed that Gretl doesn't complain if I wrongly write:
set csv_read_na = "."
Instead (as 'set' shows) it just uses the "=" character and ignores the
rest of the line, with fatal (but predictable) implications e.g. for
'join'. Maybe it should throw an error if it is getting an unquoted
string, or if it is getting something unexpected at the end.
Furthermore, if I write
set csv_read_na "."
(i.e. without the equal sign), it takes literally the three-character
thing \".\" (quote dot quote) instead of just the dot.
So quoted strings seem taboo here, which I find slightly worrying (and
took me a while to figure out the error).
cheers,
sven
11 years, 3 months
Compilation errors
by Hélio Guilherme
Hi,
I got the errors:
../libtool --mode=compile gcc -msse2 -c -g -O2 -I.. -I.. -I../lib/src
-I/usr/include/libxml2 -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -DHAVE_CONFIG_H
-DLIBDIR=\"/home/helio/lib\" -o genlex.lo ../lib/src/genlex.c
libtool: compile: gcc -msse2 -c -g -O2 -I.. -I.. -I../lib/src
-I/usr/include/libxml2 -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -DHAVE_CONFIG_H
-DLIBDIR=\"/home/helio/lib\" ../lib/src/genlex.c -fPIC -DPIC -o
.libs/genlex.o
../lib/src/genlex.c: In function 'look_up_word':
../lib/src/genlex.c:1020:14: error: 'parsing_query' undeclared (first use
in this function)
../lib/src/genlex.c:1020:14: note: each undeclared identifier is reported
only once for each function it appears in
make[1]: ** [genlex.lo] Erro 1
make[1]: Saindo do diretório `/home/helio/gretl/lib'
make: ** [lib] Erro 2
This happened in Ubuntu LTS 12.04 (32bit) and OpenSUSE 12.2 64bit.
What am I missing?
Thanks,
Hélio
11 years, 3 months
Bug in distribution graphs
by Hélio Guilherme
Hi Allin,
The only graphs working are Normal and t.
(they use set xrange, the rest use set trange)
There is a problem with the range value (max float?).
I edited the trange to a smaller values and the graphs are OK.
Can you reproduce this?
Thanks,
Hélio
---
gnuplot: using pngcairo driver
range_from_dist: got -4.5:4.5
get_png_bounds_info(): OK
range_from_dist: got -4.5:4.5
get_png_bounds_info(): OK
range_from_dist: got 0:1.79769e+308
stderr: '
set trange [0:1.79769e+308]
^
"/home/helio/.gretl/gpttmp.AyreOE", line 16: undefined value
'
gretl_errmsg: '
set trange [0:1.79769e+308]
^
"/home/helio/.gretl/gpttmp.AyreOE", line 16: undefined value
'
Failed command: 'gnuplot "/home/helio/.gretl/gpttmp.AyreOE"'
---
11 years, 3 months
ternary op with lists
by Sven Schreiber
Hi,
it seems list creation is not allowed with the ternary assignment. (Or
is it just my slightly outdated snapshot, or the fact that one branch
uses 'null', as in 'list hey = step==1 ? null : lags(step,list1)' ?)
Is this restriction actually necessary?
thanks,
sven
11 years, 3 months
crash recipe on Windows
by Sven Schreiber
Hi,
this crash is reproducible for me on Win7 (64bit OS, 32bit gretl I
think, snapshot from Aug 18th):
* open a script
* choose save as
* in the file dialog, select an existing file
* now hit shift+tab repeatedly (in an attempt to get the focus on the
filename field), until there appears a "search" field in the dialog
* hit save
thanks,
sven
11 years, 3 months