The 11 Basic G7 Commands

This is a quick introduction to these commands. Each is described in greater detail in the command reference of this User Guide and in the Reference Manual. Links to more detailed help are provided. In this basic reference, the full name of the command is given, and the abbreviated version, if available, is enclosed in quotes. Examples are highlighted in Courier fixed width font.

(ti)tle <text>

Provides a title for regressions and graphs.

For exmple,

title Consumption Function
f <variable> = <expression>
f <variable>{<date1> [- <date2>]} = <expression>
Defines the variable on the left in terms of the variables in the expression on the right.

For example,

f x = gnp/(1 + unemp[1]*@exp(0.25*time))
f index = x/x{2005.1}


[]:denotes lags, where (t-1) is denoted [1]
@:introduces a function (see the list of functions)
{<date>}:on the right-hand side denotes a specific observation.
{<date>}:on the left-hand side assigns values over the given range of periods.
(lim)its <date1> <date2> [date3]
(lim)its [<±n1> <±n2> <±n3>]
Sets limits for regressions and for @sum() commands. Estimation begins at date1; ends at date2. Simulation or forecast to date3. Quarterly dates require .1, .2, .3 or .4. Monthly dates require .001 ... .012.

For example,

lim 1975.1 2011.4 2012.3

The following example adjusts the limits setting. If limits previously were set to 1975.1 to 2011.4 to 2012.3, then the adjusted range spans 1975.2 to 2011.2 to 2013.2.

lim +1 -2 +3
(r)egress <y> = <x1>, <x2>, <x3>, ..., <xN>

Regresses y on x1, x2, etc.

The x’s may be simple expressions.

r gnp$ = g$, v$-vi$
(gr)aph <y1> [y2] [y3] [y4] ... [y7] [date1 [date2 [date3]]]

Graphs up to seven series from date1 to date2. Dates are retained from previous gr commands. (Note: the (pl)ot command is identical to the graph command.)

For example,

gr v$ c$ g$ 1979.1 2011.4
gr *
This graphs actual and predicted values from the last regression.
(ty)pe <y> [date1] [date2]

Displays the values of y from date1 to date2 on the screen. Dates need not be repeated if unchanged from previous ty commands. (Note: the (pr)int command is identical to the type command.)

For example,

ty gnp$ 1979.1 2011.4
data <name>
<date> <observation1> <observationN>
Introduces data into workspace. First number on each line is date of first observation on line. End data with a ‘;’.

For example,

data sales
2005.1 117 123 134 142
2006.1 137 143 145;
(ba)nk <bankname>

Assigns a data bank. What this means is discussed more fully in the topic on assigned banks.

For example,

ba mybank
(lis)tnames <w|a>

Displays the series names in the workspace (w) or the assigned bank (a).

For example,

lis a

This command also has a “wildcard” option, which allows you to list variable names matching a certain pattern.

For example:

lis a out*

will list all of the series in the assigned bank that start with out (such as out1 through out85).

(ad)d <filename>

Execute commands from named file.

For example,

add invest.reg

Quits and exits G7.

That is,


Previous topic

The G7 Command Reference

Next topic


This Page