In a panel study you may wish to construct dummy variables of one or both of the following sorts: (a) dummies as unique identifiers for the cross-sectional units, and (b) dummies as unique identifiers of the time periods. The former may be used to allow the intercept of the regression to differ across the units, the latter to allow the intercept to differ across periods.
You can use two special functions to create such dummies. These are found under the "Data, Add variables" menu in the GUI, or under the genr command in script mode or gretlcli.
"periodic dummies" (script command genr dummy). The common use for this command is to create a set of periodic dummy variables up to the data frequency in a time-series study (for instance a set of quarterly dummies for use in seasonal adjustment). But it also works with panel data. Note that the interpretation of the dummies created by this command differs depending on whether the data rows are grouped by unit or by period. If the grouping is by unit (frequency T) the resulting variables are period dummies and there will be T of them. For instance dummy_2 will have value 1 in each data row corresponding to a period 2 observation, 0 otherwise. If the grouping is by period (frequency n) then n unit dummies will be generated: dummy_2 will have value 1 in each data row associated with cross-sectional unit 2, 0 otherwise.
"panel dummies" (script command genr paneldum). This creates all the dummies, unit and period, at a stroke. The default presumption is that the data rows are grouped by unit. The unit dummies are named du_1, du_2 and so on, while the period dummies are named dt_1, dt_2, etc. The u (for unit) and t (for time) in these names will be wrong if the data rows are grouped by period: to get them right in that setting use genr paneldum -o (script mode only).
If a panel data set has the YEAR of the observation entered as one of the variables you can create a periodic dummy to pick out a particular year, e.g. genr dum = (YEAR=1960). You can also create periodic dummy variables using the modulus operator, %. For instance, to create a dummy with value 1 for the first observation and every thirtieth observation thereafter, 0 otherwise, do
genr index genr dum = ((index-1)%30) = 0