I went through the available panel-data functions in gretl and what I
describe below does not appear to be implemented.
I also have difficulty imagining how I could do it through a
user-defined function because I do not understand whether, and how, the
variant of panel-data structure (stacked v_1, stacked v_2, or based on
variables etc), may need to be taken into account or not.
Also, how the case of an unbalanced panel could be handled (which is
indeed my case - and as Bruce E. Hansen writes "unbalanced panels
complicate computer programming"...)
I would appreciate any suggestions.
Let a balanced panel data sample {y_{it}, x_{it}}, i=1,...,N, t=1,...,T
I want to transform the sample by subtracting from each data point the
related group-mean, i.e. the mean value of the same (same by nature)
variable across the dimension i=1,...,N
Namely to perform the operation
z_{it} = x_{it} (-) (1/N)*sum_{i=1}^N [x{it}],
i.e.
z_{it} = x_{it} (-) (1/N)*[x_{1t} + x_{2t} + ... + x_{Nt}]
and the same for the "y" variable, and any other variable in the sample.
Ideally, this has to work for both balanced and unbalanced panels., i.e.
when the "N" may differ in each t time period.
--
Alecos Papadopoulos PhD
Affiliate Researcher
Dpt of Economics, Athens University of Economics and Business
Foundation for Economic and Industrial Research (IOBE)
web:
alecospapadopoulos.wordpress.com/
ORCID:0000-0003-2441-4550