Stata Test
The test command performs Wald tests.
Contents
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)