MODIFY Instruction |
MODIFY( options ) oldequation newequation
MODIFY initiates the process of modifying the structure of an EQUATION. VREPLACE and VADD do the actual changes, which can include substituting one variable for another, directly or in differenced form, or swapping a right-side variable for the dependent variable.
Parameters
oldequation |
Source equation for the modification. |
newequation |
(output) The target for the modified equation. By default, this is the same as oldequation. |
Note
Once you do a MODIFY, all subsequent VREPLACE and VADD instructions will apply to oldequation until you do another MODIFY. If you do a series of VREPLACE or VADD operations to a single EQUATION, do only one MODIFY at the start of the sequence.
Options
PRINT/[NOPRINT]
Displays the contents of oldequation. Note that DISPLAY is a simpler way to do that.
Examples
This estimates an ARIMA model on first differences, then uses MODIFY and VREPLACE to substitute out the differences for the original series. Note that unless you also want the equation done in differences, it would be better to just add the DIFFS=1 option to BOXJENK and use FYGN3 as the dependent variable. The results will be identical, but the latter would be clearer.
set dr = fygn3-fygn3{1}
*
boxjenk(ar=8,ma=4,constant,define=a84) dr
*
modify a84 a814
vreplace dr with fygn3 diff 1
uforecast(equation=a814) fore06l 1995:10 1996:3
linreg(inst,define=supply) price
# constant quant sshift1 sshift2
modify supply
vreplace price by quant swap
frml(equation=supply) supplyeq
The LINREG instruction does an instrumental variables estimation with PRICE as the left-side variable, and saves the equation under the name SUPPLY. MODIFY and VREPLACE replace PRICE with QUANT as the left-side variable. The FRML instruction converts the equation to a formula (a FRML variable).
Copyright © 2025 Thomas A. Doan