On Sun, 1 Mar 2020, Sven Schreiber wrote:
Am 01.03.2020 um 02:17 schrieb Allin Cottrell:
> On Sat, 29 Feb 2020, Artur Tarassow wrote:
>> I would like to add additional time-dimensions (n observations) for
>> each unit in a panel. I've tried to make use of the <dataset addobs>
>> command but it does, instead, add a whole new unit:
>> Is there a 'clever' way to expand the time-dimension while leaving the
>> unit-dimension untouched?
>
> 1) Save your current panel dataset, making sure you have unit and time
> variables defined.
>
> 2) Using "nulldata", construct a panel that's larger in the time
dimension.
>
> 3) Use "join" to bring in the data from the original, saved dataset.
>
> 4) Use whatever method you fancy to populate the remaining empty
> observations in the time dimension.
Thanks Allin for the workaround, but I tend to think this should become
a feature request - which doesn't say anything about when it would be
implemented, of course.
In current git (and snapshots) I've had a go at this. There's a new
option, --panel-time, applicable to the "dataset addobs" command. So
for instance this should work to add two annual observations for
each firm in the abdata datafile (supplied with gretl).
<hansl>
open abdata.gdt
dataset addobs 2 --panel-time
</hansl>
Time-invariant series are automatically extended, as are series that
satisfy x(i,t) = x(i,t-1) + 1. Beyond that, filling in the blanks is
up to the user.
This is quite fiddly, so I'd appreciate getting reports on any bad
or unexpected behaviour.
Allin