VREPLACE Instruction |
VREPLACE( options ) oldseries BY newseries transform number
# number of lags in filter (used only with TRANS=FILTER)
# number of filter coefficients
Makes a variable replacement in an EQUATION. MODIFY is needed before VREPLACE to initiate the modification. You can also use VREPLACE to renormalize an equation so it has a different dependent variable. Use VADD to add a new variable.
Parameters
oldseries |
The variable in the original equation that you want to replace. |
newseries |
The variable replacing oldseries |
transform |
The type of transformation done originally to newseries to create oldseries. See the choices below. By default, VREPLACE does a straight replacement of oldseries by newseries. |
number |
This depends upon the choice for transform as shown below. |
Choices for transform
The left column is the choice. These can be abbreviated to three or more characters. The right column is the description.
difference |
With number as the number of differences |
sdiff |
With number as the number of seasonal differences. |
filter |
With the supplementary cards from FILTER repeated. |
equation |
Filter with number as the identifier for the EQUATION form used. |
prewhitened |
Residuals from an ARMA model with number as the identifier for the estimated EQUATION. |
lag |
With number equal to the lag. |
swap |
Renormalizes the equation so newseries is the new dependent variable, replacing oldseries. The zero lag of newseries should be present in the equation. |
Options
PRINT/[NOPRINT]
If PRINT, display modified equation.
Supplementary Cards
For a transform of FILTER, include the same supplementary cards which you used on the FILTER instruction.
Examples
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
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.
instruments constant dshift1 dshift2 sshift1 sshift2 sshift3
linreg(inst,frml=demandeq) price
# constant quantity dshift1 dshift2
linreg(inst,define=supplyee) price
# constant quantity sshift1 sshift2 sshift3
modify supplyee
vreplace price by quantity swap
frml(equation=supplyee) supplyeq
group market demandeq>>f_price supplyeq>>f_quant
estimates a supply-demand system by two-stage least squares, with PRICE as the left hand side variable in both equations. The MODIFY and VREPLACE instructions replace PRICE with QUANTITY on the left side of the supply equation, and the FRML converts the equation into a formula. The GROUP instruction groups the two formulas into a system which will determine both PRICE and QUANTITY.
boxjenk(ar=1,ma=1,define=yprewh) y / yres
boxjenk(ar=2,ma=0,define=xprewh) x / xres
boxjenk(ma=1,inputs=1,define=trfunc) yres
# xres 0 1 0
modify trfunc
vreplace yres by y prewhitened yprewh
vreplace xres by x prewhitened xprewh
computes a transfer function model of Y on X. This first prewhitens Y and X by ARMA(1,1) and ARMA(2,0) models, respectively.
Copyright © 2025 Thomas A. Doan