---------- Forwarded message ----------
Date: Sat, 1 Jul 2023 14:41:57 +0000
From: Allin Cottrell <cottrell(a)wfu.edu>
To: 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 [...]
It might be worth noting that you can get the same result with a good deal
fewer commands by exploiting gretl's matrix methods:
set verbose off
open grunfeld
# turn "invest" into a T x N matrix
matrix m = mshape({invest}, $pd, max($unit))
# scale @m and turn it back into a series
series invest_idx = mshape(100 * m ./ m[1,], $nobs, 1)
print invest_idx --byobs
Allin Cottrell