group |

Declare a group object containing a group of series.

Syntax

group group_name ser1 ser2 [ser3 ...]

Follow the group name with a list of series to be included in the group.

The wildcard operator, *, may be used as part of the series list to include many series at once. The keywords AND or NOT can be used to specify certain series should not be included in the group.

Examples

group g1 gdp cpi inv

group g1 tb3 m1 gov

g1.add gdp cpi

The first line creates a group named G1 that contains three series GDP, CPI, and INV. The second line redeclares group G1 to contain the three series TB3, M1, and GOV. The third line adds two series GDP and CPI to group G1 to make a total of five series. See
Group::add.

group rhs d1 d2 d3 d4 gdp(0 to -4)

ls cons rhs

ls cons c rhs(6)

The first line creates a group named RHS that contains nine series. The second line runs a linear regression of CONS on the nine series in RHS. The third line runs a linear regression of CONS on C and only the sixth series GDP(-1) of RHS.

group g2 us_*

This line creates a group named G2 that contains any series whose name starts with the characters US_.

group g3 * not resid

This command makes a group, G3, containing all series in the workfile except for the resid series.

group g4 a* and *1

Makes a group named G4 containing all series whose names begin with the letter A and end with L.

group g5 a* b* not *1 *2

This line makes a group, G5, containing all series whose names begin with either letter A or B and do not end with either 1 or 2.

group g6 g1 and g2

Makes a group named G6 containing all series that are both in group G1 and group G2 (i.e. the intersection of the two groups).

Cross-references

See
“Groups” for additional discussion.

See also
Group::add and
Group::drop.