On Tue, 1 Oct 2013, Riccardo (Jack) Lucchetti wrote:
On Tue, 1 Oct 2013, Artur T. wrote:
> Hi all,
> I've got an issue with the following. It used to work in the past, but
> doesn't do so anymore. I want to estimate a panel model for a sub-sample
> dataset. I am using current cvs on linux.
>
>
> <hansl>
> open abdata.gdt
>
> # Restriction for which panel structure remains
> smpl YEAR > 1977 --restrict
> smpl full
>
> # Restriction for which panel structure doesn't remain
> # -> Undated dataset
> smpl YEAR > 1977 && EMP > 40 --restrict
>
> # Redefinition to panel structure is not allowed acc. to gretl
> setobs unit YEAR --panel-vars
> <\hans>
Yes, this is a problem for me too. It breaks a (long) script I'd written some
time ago. The reason is laid out in
http://lists.wfu.edu/pipermail/gretl-users/2013-September/009211.html
[...]
Yes, here's the point. If you subsample a panel dataset so that it becomes
unbalanced, then insist on turning it into a panel again, we have to
rebalance it by inserting "padding" rows of NAs. Then if you later do
"smpl full" we have to remove the padding and stick back in the original
values, while carrying back to the full dataset, on the right rows, any
data added or revised while the subsampling + padding was in effect.
This is on the very edge of what we can do reliably (moreover, it's not
100% clear how to define "doing it right"), so after Artur's report of a
segmentation fault (referenced in the posting that Jack cites above --
Artur, you should remember this ;-) I decided to go for "safety first" and
ban that sort of rebalancing via padding.
In fact, however, there's a "back door" which allows you to do this: when
you impose the unbalancing restriction, add the --balanced option to the
smpl command!
This whole thing needs some more investigation. I guess for consistency we
should either scrap the --balanced option or reactivate the balancing mode
that's now disabled. Whenever I try to think this issue through it makes
my head hurt, but I'll see what I can do...
Meanwhile, of course, the safe option is to "store" the subsampled
dataset, reopen it, and apply --panel-vars at will.
Allin