---------- Forwarded message ----------
Date: Sat, 1 Jul 2023 17:36:11 +0000
From: "Riccardo (Jack) Lucchetti" <p002264(a)staff.univpm.it>
Reply-To: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
To: Allin Cottrell <cottrell(a)wfu.edu>
Cc: Josué Martínez-Castillo <jota3mc(a)gmail.com>,
Subject: Re: 100-based indices with panel data
On Sat, 1 Jul 2023, Allin Cottrell wrote:
On Fri, 30 Jun 2023, Josué Martínez-Castillo wrote:
> Hi,
> I'm a newbie in gretl, very excited to learn how to use the program for
> learning econometrics on my own. However, right now I'm curious on how to
> estimate 100-based indices when dealing with panel data. For example, what
> if I want to estimate a 100-based index for each unit using as base year
> the first year available of, say, real GDP.
>
> I was looking for the answer in the manual of the 2023 version of gretl. No
> success. I was hoping maybe someone can help me with guidance.
Good question. As things stand there isn't a built-in way to construct such
indices for panel data using the graphical interface. But assuming you want
the indices to work in the time dimension for each panel unit, it's actually
not hard to do via scripting. Here's an example:
[...]
Here's another approach, which avoids the loop. The syntax is a bit too terse,
perhaps, but IMO instructive.
<hansl>
open abdata.gdt
base = cum(ok(EMP)) == 1 ? EMP : NA
EMP_b100 = EMP/pexpand({base}) * 100
print EMP EMP_b100 --byobs
</hansl>
We should probably find a way to offer this as a built-in thing.
Agreed.
-------------------------------------------------------
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
-------------------------------------------------------