Equation and Regression List Functions |
A regressor list is a representation of a coded list of regressors as used in regression format. Anywhere the syntax requires input in regression format, you can use a VECT[INTEGER] which has been created using the regressor list functions as all or part of the input. (Don't try to create these without the specialty functions).
A regressor table is the result of expanding a regressor list. It's a 2 × K RECT[INTEGER], where K is the number of variables. The first row has the "handle" of the series and the second is the lag/lead number. (Lag's are positive). There are functions for merging, searching and pruning the set of regressors using these.
An EQUATION is the standard object that regresents a linear equation. A regressor table and an associated coefficient VECTOR are the main elements of that.
Coefficients of an equation |
|
Copy of an equation |
|
Dependent variable of an equation |
|
“Identity” tag for an equation |
|
Get “handle” of an equation |
|
Lags the right hand side of an equation |
|
Extract lag polynomial from an equation |
|
Fitted value of an equation for a given entry |
|
Gets labels for regressors of an equation |
|
Residual value of equation at entry t |
|
Residual value of equation at entry t given coeff. vector |
|
Create a single regressor for an equation |
|
Sets the coefficients of an equation |
|
Sets the “identity” tag for an equation |
|
Sets the residuals associated with an equation |
|
Sets the residual variance of an equation |
|
Number of explanatory variables in equation |
|
List of variables/lags in an equation |
|
Value of linear equation for given entry and coefficients |
|
Variance associated with an equation |
|
Extract an X(t) vector for an equation |
|
Get current instruments as a regressor list |
|
Get current instruments as a table |
|
Extract an X(t) for the current instrument set |
|
Returns the default internal PARMSET |
|
Returns the labels of the variables in the parameter set |
|
Returns the output labels from the most recent estimation |
|
Get regressor list from last regression |
|
Reload regression saved with %REGSAVE() |
|
Save a regression coded into a VECTOR of INTEGERS |
|
Returns the "table" of series and lags from most recent regression. |
|
Add a lagged regressor to a regressor list |
|
Add list of lags to a regressor list |
|
Add a regressor to a regressor list |
|
Concatenate two regressor lists |
|
Number of regressors in list |
|
Returns an empty regressor list |
|
Get a regressor list from an equation |
|
Convert a regression table to a regressor list |
|
Verify a regressor list |
|
Extracts subtable from T1 that isn't in T2 |
|
Extracts subtable from a table |
|
Locate a single (variable,lag) pair in a table |
|
Locate variables from one table in another |
|
Locate occurrences of a single variable in a table |
|
Locate variables missing from a table |
|
Create table from regressor list |
|
Merge two regressor tables |
|
Locates series (ignoring lags) in a table |
These are designed to work with general list of "regressors" as they are handled by RATS, with series or series-lag combinations. The following builds up a list of the dependent variables and regressors for a cointegration procedure. The original dependent variables are in the VECT[SERIES] V, while the differenced versions are in DV. The list needs to include:
1.The current differenced variables (added with %RLADDONE)
2.The first lag of the original variables (added with %RLADDLAG)
3.L–1 lags of each differenced variable (added with %RLADDLAGLIST)
4.The deterministic variables, if needed (%RLADDONE)
First, we define an empty regression list called REGLIST. We then use other regressor list functions to add additional terms to the existing list and save the result back into REGLIST.
compute reglist = %rlempty()
do i=1,numvar
compute reglist=%rladdone(reglist,dv(i))
end do i
do i=1,numvar
compute reglist=%rladdlag(reglist,v(i),1)
end do i
if lags>1
do i=1,numvar
compute reglist=%rladdlaglist(reglist,dv(i),$
%seq(1,lags-1))
end do i
if determ>=2
compute reglist=%rladdone(reglist,constant)
if determ>=3
compute reglist=%rladdone(reglist,trend)
Copyright © 2025 Thomas A. Doan