G7 Commands: C

(cat)ch [-a|-w] <catchfile>
The catch command captures most screen output (except graphs) to the named <catchfile>. The default flag “-w” causes a new file to be created. The optional “-a” flag causes G7 to open an existing file and append text to the end. This command is used to capture the set up of a regression and its results into a file. A regression display is caught as it stands when you proceed to the next command. To turn off the catching type “catch off”. The catch command can also be used as a clever way to create new add files. Simply catch the results of a session, go in and edit out the extraneous output, and voila, a new add file!

Related Topics: add, regress, zip

(cb)k <bank_name> [<bank_location>]
The cbk command assigns a compressed bank (.CBK, .CIN). The <bank_location> is optional, and may be a letter between ‘a’ and ‘z’. If no letter is given, the position will be ‘a’. The compressed bank comes in two files. The first file, with extension .CBK, holds the data series in compressed format, and the second file, with extension .CIN, holds an index of names of series. When you give the <bank_name>, give only the “root name”, that is, without the file extension.

Related Topics: Assigned Banks, bank, dfr, hbk, listbanks, vam

cc <C language statement>
This has no effect in G7 or Build, but the C-language statement is passed through to the file HEART.CPP, which contains the model written in the C++ language and is ready for compilation. Such passed-through statements may be used to do special tasks for which G7 and Build have no convenient mechanism – such as scaling one group of variables to sum to another variable. For many models, no cc statements are needed.

Related Topics: Model Building

cd <directory>
Change the current working directory to <path>. This is equivalent to the menu option File | Directory.

Normally when starting G7, you are asked to specify the location of the G.CFG you would like to use for identifying the default assigned bank and current working directory. Using the cd command, you can change the current working directory. After giving this command, G7 will look in that directory when searching for .add files, .reg files, and databanks.

Related Topics: G.CFG, pwd

(ch)ow <n>
The chow command is a test of homogeneity. In the calling format above, <n> is the number of regressions involved in the test.

A Chow test is a special case of the Fisher F test used to test the homogeneity of a sample. Typically, one runs two or more regressions covering parts of a sample and compares the sum of squared errors with that of a single regression covering the whole sample. If we were going to break up the sample into two parts, the command would be

chow 3

Then we run first the two regressions over the separate halves of the sample, and finally the single regression over the whole sample. After this last regression, one will be greeted by the results of the Chow test.

There is a special case in which the second portion of the sample is too small to run the regression. In that case, give the command:

chow 2

and then run the regression over the reduced sample and then again over the whole sample. After the second regression, the Chow tests appear.

Related Topics: Regression Tests

clear
cls
The clear command can be used to clear the contents of the results window. This window can be useful for viewing the history of a G7 session, but as it gets larger it may scroll more slowly. This command is equivalent to the File | Clear Results command from the menu.
close <bank letter> [<bank letter> <bank letter> … ]
close all
The close command is used to close a bank, multiple banks, or all banks.

Examples

close all    # close all open banks except the workspace bank
close a      # close bank 'a'
close c d e  # close banks 'c', 'd', and 'e'
cmtype <yes | no>
vcprint <yes | no>
If “yes”, the simple correlation matrix and the standard deviation of each variable will be typed before the regression results. The default is “no.”
coef [-c|r] <matrix> <vec> [year]
Convert the named flow matrix to a coefficient matrix by dividing each column of the matrix by the corresponding element of the named vector. If no year is named, the command works over the fdates range. If the ‘-r’ option is specified, then each row of the matrix will be divided by the corresponding vector element; otherwise, the default ‘-c’ setting is assumed or may be specified to indicate that column elements should be divided by vector elements.

Related Topics: fdates, flow, getsum, move, ras, rowscale, scale

(comc)oef <common_variables> <total_variables>
It happens fairly frequently that we have similar data sets collected at different times or in different places. We then may wish to estimate regressions which combine the data sets in various ways. The comcoef command in G7 is designed for this purpose. It allows one to specify a number of “common coefficients” in the regressions that follow. The method may be explained best with an example. In the following example, “cps78” and “cps85” are data banks of from the Current Population Surveys of 1978 and 1985, respectively. The first has data on 550 individuals, the second on 534 individuals. We want to regress the logarithm of an individual’s wage, lnwage, on the individuals education, ed. We want the coefficient of lnwage to be the same in both samples, but the interecepts may be different in the two years.

Here is what we do.

f one = 1
comcoef 1 4
hbk cps78
lim 1 550
r lnwage = ! ed, one
hbk cps85
lim 1 534
r lnwage = ! ed, one
do

In the comcoef command, the “1” tells the program to use the same coefficient for the first 1 variable(s) in all the following regressions. The “4” is the total number of variables, counting the dependent variable, in the combined or “pooled” regression. Once the comcoef command has been received, G7 accumulates regressions until the do command is reached. Only a limited set of commands are a permitted between the comcoef command and the do command. They are the bank, hbk, lim, f, add, pause, quit, and r commands. The quit command only quits comcoef, not G7.

The comcoef command can be used under the chow command and under the catch command. It also puts the estimated coefficients into the rcoef series in the workspace bank, as usual. It does not enter a series of predicted values into the workspace bank, so gr * will not work following a comcoef regression, nor are the variable names shown on the display of the results, for in general the variables with a common coefficient may have different names while variables with different coefficients may have the same name, such as “one” in the above example.

commandcache <clear>
commandcache <print>
commandcache <replay>
These provide control over the command-line cache, where each command-box entry is recorded. Commands allow printing of the cached commands, clearing of the cache, and execution of the cached commands.
con <top> <c> = <linear function of ai’s>
The con command imposes a “soft constraint” on a regression. The <top> (trade-off) parameter determines how “soft” is the constraint. The higher is this number, the harder the constraint. The constraint counts as top*T observations, where T is the number of regular observations in the regression. Soft constraints are also know as “Theil’s mixed estimation,” as “stochastic constraints,” and are also a particular type of Bayesian regression.

Remember to put the value <c> of the constraint on the left hand side. Note that one parameter may appear in one or more constraints, but be careful not to impose constraints that are inconsistent!

We often use soft constraints when theory suggests that a parameter should be near a certain value, but ordinary regression gives a raw parameter that is not consistent with what theory suggests. Often, the theoretically sensible parameters also are those that lend stability to our models. The use of soft constraints also is implicit in the estimation of Almon lags, imposed using the sma command.

The con commands must be given before the regression to that they apply, and they will be cleared after that regression is estimated.

Examples:

con 100 1 = a3 + a4 + a5
con 200 0 = a7 - 3a6 + 3a7 - a8

Related Topics: Soft Constraints, qpcon, sma

(ct)rl <x> <concept> <group>
The ctrl command imposes the values of <x> series as a control total on a <group> of sectors of a given <concept> (such as exports). Results are stored in the workspace bank with names formed by <concept> and the given sectors.

For example, the command:

ctrl tot out 1-10 (4-7) 13 15

imposes the values of tot as a control total on the named sectors out, i.e. sectors 1 to 10, except for 4 through 7, and then 13 and 15.

Related Topics: Forming Variables, Groups, group, scale