[Gretl-users] Stata-like drop command

Artur T. artur.tarassow at googlemail.com
Wed Jul 31 06:50:25 EDT 2013

Hello gretl users,

is there a command like "drop" (Stata) available in gretl? I would like
to drop units from a panel data set with less than x observations.

The reason is the following. Assume I have two units, A and B. For unit
A I have a fully balanced panel with three consecutive observations from
2000 to 2002. For unit B I have only two obs for 2000 and 2002,

Variable X:
2000: 10	#unit A
2001: 11
2002: 9

2000: 10	# unit B
2002: 13

If I translate these obs into a matrix, I obtain a vector V with five
V = { 10 11 9 10 13 }

This even happens if I run:
series pn = pnobs(A)
smpl pnobs==pn --restrict --replace

If one could drop these units from the variables by a "drop"-like
command, this problem would not arise. Of course, alternatively one
could store the restricted dataset temporarily and re-open it, but then
lists and other stuff gets lost as well...


More information about the Gretl-users mailing list