DROP (Interactive)

Examples

DROP is used to drop a list of variables from the previous statement and re-execute it. It is the opposite of ADD.

DROP <list of variables> ;

Usage

DROP is a convenient way to drop variables from a regression and perform a second estimation (without retyping the command). It is not restricted to this usage and may be used anywhere this type of command modification is needed.

The command

DROP var1 var2

and the sequence

RETRY

>> DELETE var1

>> DELETE var2

>> EXIT

are identical in function since both permanently modify the previous command by deleting the first occurrences of var1 and var2. 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. DROP will not accept a line number argument, and always modifies the last line that is not itself a DROP (or ADD) command.

Because of the way "previous" is defined for this procedure, you can 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.

Note that 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.

Output

DROP echoes the modified command it will execute. Any further output will be a direct result of the command that is executed by it.

Examples

OLSQ (WEIGHT=POP) YOUNG,C,RSALE,URBAN,CATHOLIC

DROP URBAN

will run two regressions, the second of which is:

OLSQ (WEIGHT=POP) YOUNG,C,RSALE,CATHOLIC

This is also how the command will now look if you REVIEW it, since it has been modified and replaced in TSP's internal storage, and in your backup file.