RATS 10.1
RATS 10.1

TEST( options )

# list of coefficients to be restricted (except with ALL option)

# constants against which coeff. are tested (only with NOZEROS)

 

Tests restrictions on sets of individual coefficients. You can also use it for tests of equality between two coefficient vectors and to do a simple Hausman test. In terms of complexity, it falls between EXCLUDE, which is simpler, but tests only zero restrictions, and RESTRICT and MRESTRICT, which test general linear restrictions.

Wizard

In the Statistics—Regression Tests Wizard, you can use "Exclusion Restrictions" to test zero restrictions (equivalent to TEST(ZEROS)), or "Other Constant Restrictions" if some are non zero (equivalent to TESTS(NOZEROS)).

Supplementary Cards

1.List the numbers of the coefficients which enter the restriction, by coefficient numbers, not by variable names. RATS puts coefficients for a LINREG or similar instruction in the regression in the order listed on the supplementary card. You can use TO triples, like “1 TO 5”, to abbreviate the list.

2.List the values you want these coefficients to assume under the restriction. TEST computes a joint test of these restrictions.

Options

[PRINT]/NOPRINT

TITLE="title for output" [none]

NOPRINT suppresses the regular output. You may want to use this option if you are just using TEST to compute the variables %CDSTAT or %SIGNIF. You can use the TITLE option to include information in the output to identify what is being tested.
 

ZEROS/[NOZEROS]

ZEROS tests zero restrictions. Omit the second supplementary card if you use ZEROS.

 

ALL/[NOALL]

Use ALL to test whether all of the coefficients can be excluded. Omit the supplementary card if you use this. This option was called WHOLE before version 7.

 

VECTOR=VECTOR against which coefficients are tested [zero]

The VECTOR is a VECTOR which supplies the restricted values. If you use it, omit the second supplementary card. It must have the same size as the current regression. Used properly, this permits tests between two estimated coefficient vectors.

 

COVMAT=input covariance matrix [unused]

COEFFS=input coefficient matrix [unused]

These options provide an easy way to implement a Hausman test. Just save the covariance matrix and coefficient vector from the first (less efficient) estimation, do the second estimation, and then do TEST, using the options to input the saved covariance and coefficient arrays from the first regression.

 

FORM=F/CHISQUARED

Determines the form of test statistic used. RATS can normally select the appropriate form for the Wald test by default based on estimation technique used last. You can use the FORM option to manually select a distribution if you have made changes to the regression, such as altering the %XX matrix, that require a different distribution.

 

ENTRIES=number of entries to use from supplementary card [all]

Notes

If you use the VECTOR option with a coefficient vector which has been estimated, you will get an incorrect test unless you replace the current %XX array by the covariance matrix of the difference between the two estimators. If not, TEST will use the covariance matrix of the more recent estimator, which is correct only for a test against a fixed set of values.
 

If the current covariance matrix is not full-rank, TEST will adjust the degrees of freedom of the test appropriately. The %NDFTEST variable is set to the number of degrees of freedom.

 

The main test statistic is usually shown as an F, but will be shown as a chi-squared when TEST is applied to likelihood-based estimates (from, for instance, DDV or GARCH instructions) or from any instruction for which the ROBUSTERRORS option was used during estimation.

 

For F-tests with one degree of freedom, TEST will report a two-tailed t test in addition to the F test.

 

For chi-squared tests with more than one degree of freedom, TEST 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.

Variables

%CDSTAT

the computed test statistic (REAL)

%SIGNIF

the marginal significance level (REAL)

%NDFTEST

(numerator) degrees of freedom for the test (INTEGER)

Examples

linreg logd 1 150

# constant logy logown logother

test(title="Test for Unit Elasticity")

#   3

#  -1.0

 

This tests whether the LOGOWN coefficient is –1.0.


 

instruments constant z1 z2

linreg(inst) y

# constant x1 x2

compute [vect] beta2sls = %beta, [symm] xx2sls=%xx

instruments(add) z3 z4 z5

linreg(inst) y

# constant x1 x2

test(coeffs=beta2sls,covmat=xx2sls-%xx)

 

performs a Hausman test, comparing the 2SLS estimators from a small instrument set with that from a larger set which contains the first.


 

linreg lgnp

# constant lgnp{1} trend dgnp{1 to 4}

*

* This computes the joint F-test. We suppress the printing,

* because it will give a misleading p-value, based upon an F and

* not the non-standard distribution.

*

test(noprint)

# 2 3

# 1.0 0.0

disp "ADF Joint test for p=1, and trend=0" %cdstat

 

This does a Dickey-Fuller joint test. While the Wald test gets the statistic correct, it has a non-standard distribution, hence the use of NOPRINT (which will show a standard F significance level).

 


Copyright © 2025 Thomas A. Doan