[Gretl-devel] panel data issues

Riccardo (Jack) Lucchetti r.lucchetti at univpm.it
Tue May 7 11:40:56 EDT 2013


On Sun, 5 May 2013, Sven Schreiber wrote:

> 3: About pshrink(): A version that returns a full panel series (with
> repeated values like pmean() etc.) could be useful -- practical example:
> in growth regressions one needs the initial value of output-per-worker
> as a regressor. Also maybe it should be called "pfirst()" or something
> instead.
>
> 4: Time-constant variables: I'm not sure how to create variables that
> only vary along the cross-section, like it is done with the built-in
> pmean() etc. functions. Or how to append them (like the user guide p.114
> "adding a time series", but along the other panel dimension).

This can be done quite compactly by using the "replace" function: to 
illustrate this, I'll use your point 3.

<hansl>
open abdata.gdt --quiet
series first_n = replace($unit, values($unit), pshrink(n))
</hansl>

Probably not the most intuitive thing in the world, though, I must admit.

> 5: Constant in a fixed-effects regression: I don't understand what gretl
> reports as the global constant term in a fixed-effects model, and it
> doesn't seem to be defined in the guide. It's also confusing that gretl
> complains if one wants to discard the constant in the specification
> dialog (when fixed effects are selected).  (But obviously gretl
> estimates the right thing as the comparison with explicit LSDV
> regression shows, just the constant is mysterious -- even if it's the
> average of the fixed effects it's not clear where the standard errors
> come from.)

What we run internally can be exemplified as

<hansl>
open abdata.gdt --quiet
panel n const w k ys

depvar = n - pmean(n) + mean(n)
list indvars = const
loop foreach i w k ys
     x_$i = $i - pmean($i) + mean($i)
     list indvars += x_$i
end loop
ols depvar indvars
</hansl>

with an obvious degrees-of-freedom correction for the covariance matrix. I 
don't like it very much either, but at some point we decided that since 
the constant in a fixed effects regression is conventional anyway, we 
might as well ensure compatibility with Stata.


-------------------------------------------------------
   Riccardo (Jack) Lucchetti
   Dipartimento di Scienze Economiche e Sociali (DiSES)

   Università Politecnica delle Marche
   (formerly known as Università di Ancona)

   r.lucchetti at univpm.it
   http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------


More information about the Gretl-devel mailing list