Command Reference : Function Reference : Function Reference: C
  
 
@cellid
Panel workfile series containing within cross-section identifier for observation.
Syntax: @cellid
Return: series
Returns index of the within cross-section identifier for each observation in the workfile.
In a panel workfile, the index numbers identify the unique values of the within cross-section dimension.
In a non-panel workfile, the index numbers are equivalent to sequential observation numbers.
Examples
wfcreate a 2001 2022 10
series ids = @cellid
creates a balanced 10 cross-section panel, with 22 observations per cross-section, and saves a series with indices (1 to 22) corresponding to the year of the observation.
If we have an unbalanced panel
series ubids = @cellid
will contain indices uniquely identifying the values of the all of the within cross-section identifiers observed in the workfile.
Thus, in a two-cross section panel where the first cross-section has annual observations for 1990, 1992, 1994, and 1995, and the second cross-section has observations for 1990, 1995, and 1997, the corresponding index values will be of the form (1, 2, 3, 4) and (1, 4, 5), respectively.
Cross-references
See also @obsrange, @crossid, and @obsid.