ADD adds a list of variables to the previous statement and re-executes it. It is the opposite of DROP.
ADD <list of variables> ;
ADD offers a convenient means of adding variables to a regression and performing a second estimation (without having to fully retype the command). It is not, however, restricted to this usage, and may be used in any circumstance where this type of command modification is needed.
The command
ADD var1 var2
and the sequence
RETRY
>> INSERT var1
>> INSERT var2
>> EXIT
are identical in function since both permanently modify the previous command by inserting var1 and var2 at the end of the command. The command is then automatically executed in both cases. The only potential difference between these approaches (besides the amount of typing) is in the definition of "previous". RETRY with no line number argument assumes you want to modify the last line typed. ADD will not accept a line number argument, and always modifies the last line that is not itself an ADD (or DROP) command.
ADD and DROP allow you to execute a series of closely related regressions by entering the first estimation command, followed by a series of ADD and DROP commands. Since each ADD or DROP permanently alters the command, each new modification must take all previous modifications into account.
Notes
It is not possible to combine ADD and DROP into one step to perform a replace function, or to make compound modifications to a command. In these circumstances, RETRY must be used.
OLSQ (WEIGHT=POP) YOUNG,C,RSALE,URBAN,CATHOLIC
ADD MARRIED
will run two regressions, the second of which is:
OLSQ (WEIGHT=POP) YOUNG,C,RSALE,URBAN,CATHOLIC,MARRIED
This is also how the command will now look if you REVIEW it, since it has been modified and replaced both in TSPs internal storage and in the backup file.
Another use for ADD might be in producing plots. The following will produce two plots with the same option settings, but two series are added to the second plot.
PLOT (MIN=500,MAX=1500,LINES=(1000)) GNP G GNPS H
ADD CONS C CONSS D