RESTRICT Instruction |
RESTRICT( options ) restrictions residuals coeffs
# list of coefficient numbers
# coefficient weights followed by restricted values
(one pair of supplementary cards per restriction)
RESTRICT has two functions: testing general linear restrictions, and (with the option CREATE) doing regressions subject to linear restrictions. After a discussion of the elements of the instruction common to both uses, there are separate subsections for each.
MRESTRICT is a similar instruction which uses matrices to input the form of the restrictions.
Wizard
You can use the Statistics—Regression Tests Wizard to perform restriction tests.
Parameters
restrictions |
number of linear restrictions |
residuals |
(Optional) With the CREATE option only, this is a series for the residuals from the restricted regression. Note that the standard %RESIDS series is set to the residuals as well, so you will rarely need this. |
Supplementary Cards
Represent each restriction by a pair of supplementary cards. On the first, list the numbers of the coefficients which enter the restriction. On the second supplementary card in each pair, list the weights attached to the coefficients listed on the first card, followed by the value which this linear combination of coefficients takes.
Note that you list the coefficients entering the restriction by coefficient numbers rather than by variable names. RATS puts the coefficients for a LINREG or similar instruction in the regression in the order listed on the supplementary card, with a block of lags ordered from the lowest lag (highest lead) to the highest lag.
Examples of Supplementary Cards
\(\beta_5 = 4.0\) (or \(1 \times \beta_5 = 4.0\))
# 5
# 1.0 4.0
\(\beta_1 - 2 \beta_2 + \beta_3 = 4.0\)
# 1 2 3
# 1.0 -2.0 1.0 0.0
Hypothesis Tests
RESTRICT, when used without the option CREATE, operates like the other hypothesis testing instructions (EXCLUDE, TEST). It does not make any changes to the stored information about the last regression, so any additional hypothesis testing instructions will apply to the original regression. RATS ignores the residuals parameter on the instruction line.
The main test statistic is usually shown as an F, but will be shown as a chi-squared when RESTRICT is applied to estimates from GARCH, DDV and similar instructions which do maximum likelihood estimation, or from any instruction for which the ROBUSTERRORS option was used during estimation.
For F tests with one degree of freedom, RESTRICT will report a two-tailed t test in addition to the F test. For chi-squared tests with more than one degree of freedom, RESTRICT will report an F with an infinite number of denominator degrees of freedom (that is, the chi-squared statistic divided by the numerator degrees of freedom) in addition to the chi-square.
You can also control the distribution yourself using the FORM option.
Options
See RESTRICT Options
Variables Defined
%CDSTAT |
the computed test statistic. (REAL) |
%SIGNIF |
the marginal significance level (REAL) |
%NDFTEST |
(numerator) degrees of freedom for the test (INTEGER) |
%BETA |
VECTOR of coefficients (if CREATE or REPLACE option) |
%RESIDS |
SERIES of residuals (if CREATE or REPLACE option) |
Examples
Suppose you have the following equation:
\({y_t} = {\beta _0} + {\beta _1}{\kern 1pt} {x_1}_t + {\beta _2}{\kern 1pt} {x_2}_t + {\beta _3}{\kern 1pt} {x_3}_t + {u_t}\)
which can be estimated using:
linreg y
# constant x1 x2 x3
We want to test the simple hypothesis that \(\beta_1 = \beta_2\). RESTRICT operates by testing whether a linear combination of coefficients is equal to a specific value, so we need to rewrite this hypothesis in this form: \(\beta_1 - \beta_2 = 0\).
We are testing the second and third coefficients here, so the RESTRICT would be:
restrict 1
# 2 3
# 1.0 -1.0 0.0
If you want to compute the restricted regression, do:
restrict(create) 1
# 2 3
# 1.0 -1.0 0.0
The following estimates the translog cost function
\(\log \left( {C/Q} \right) = \alpha + \sum\limits_i {{\alpha _i}\log {w_i}} + \sum\limits_j {\sum\limits_{j \le i} {{\gamma _{ij}}\left( {\log {w_i}} \right)\left( {\log {w_j}} \right)} } \)
and tests (jointly) the following combination of restrictions
\(\begin{array}{l}{\alpha _1} + {\alpha _2} = 1.0 \\ {\gamma _{11}} + 0.5{\gamma _{12}} = 0.0 \\ {\gamma _{22}} + 0.5{\gamma _{12}} = 0.0 \\ \end{array}\)
set logulc = log(ulc)
set logw1 = log(w1)
set logw2 = log(w2)
set lw1w1 = logw1^2
set lw2w2 = logw2^2
set lw1w2 = logw1*logw2
linreg logulc
# constant logw1 logw2 lw1w1 lw1w2 lw2w2
restrict 3
# 2 3
# 1.0 1.0 1.0
# 4 5
# 1.0 0.5 0.0
# 5 6
# 0.5 1.0 0.0
The following estimates a piecewise linear regression of C on Y, where the knot is at T=29. The restriction forces the two segments to meet at the knot.
set d2 = (t>=29)
set dy2 = y*(t>=29)
linreg c
# constant y d2 dy2
restrict(create) 1
# 3 4
# 1.0 y(29) 0.0
The code below estimates a four lag autoregression on LGNP and forces the lag coefficients (numbers 2 through 5) to sum to one.
linreg lgnp
# constant lgnp{1 to 4}
restrict(create) 1
# 2 3 4 5
# 1 1 1 1 1
Copyright © 2025 Thomas A. Doan