Differences between revisions 1 and 2
Revision 1 as of 2024-02-28 16:56:20
Size: 2219
Comment: Initial commit
Revision 2 as of 2025-01-10 16:08:54
Size: 2217
Comment: Killing Econometrics page
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''`test`''' command performs [[Econometrics/WaldTest|Wald tests]]. The '''`test`''' command performs [[Statistics/WaldTest|Wald tests]].

Stata Test

The test command performs Wald tests.


Usage

The test command supports one type of syntax when called as itself, and a second type of syntax when called as testparm.

Test Syntax

Test that one or more coefficients are equal to 0.

// Coefficients represented by variables
test x1
test x1 x2

// Coefficients represented by factor indicators
test x1.a

Test that two coefficients are equal to each other.

// Coefficients represented by variables
test x1 = x2

// Coefficients represented by factor indicators
test x1.a = x2.a

If used after a multi-equation model was run, by default, these tests check that coefficients are equal to 0 in all equations. To specify an equation, try:

// Test equal to 0
test [y1]x1
test [y1]x1 [y2]x1

// Test equal to each other
test [y1]x1 = [y2]x1

// Alternative syntax:
test [y1=y2]: x1

Similarly, to test all coefficients between two equations, try:

// Test all coefficients for equality to each other
test [y1=y2]

// Or, if not all coefficients are common to both equations, try:
test [y1=y2], common

Linear transformations can also be tested for equality.

test x1 + x2 = 4
test 2*x1 = 3*x2

TestParm Syntax

Test that one or more coefficients are equal to 0.

// Coefficients represented by variables
testparm x1

// Standard varlist syntax applies
testparm x1-x9
testparm x*

// Coefficients represented by indicators
testparm i.x1

// Coefficients represented by interactions of indicators
testparm i.x1#i.x2

Test that two or more coefficients are equal to each other.

testparm i.x1, equal

If used after a multi-equation model was run, by default, these tests check that coefficients are equal to 0 in all equations. To specify an equation, try:

// Test equal to 0
testparm i.x1, equation(y1)

// Test equal to each other
testparm i.x1, equal equation(y1)


See also

Stata manual for test


CategoryRicottone

Stata/Test (last edited 2025-04-04 01:03:58 by DominicRicottone)