Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2025-04-04 01:03:43
Size: 2159
Comment: Standardize
Revision 7 as of 2025-10-24 18:53:48
Size: 2267
Comment: Rewrite
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''`test`''' command performs [[Statistics/WaldTest|Wald tests]]. '''`-test-`''' performs [[Statistics/WaldTest|Wald tests]].

See also [[Stata/TestParm|-testparm-]].
Line 18: Line 20:
Line 20: Line 23:
Line 26: Line 30:
The F statistic of the hypothesis is 3.47, corresponding to a significance level of about 0.07. In most settings, this would be considered insufficient to reject the null hypothesis: the factor is not significant. The [[Statistics/FTest|F-statistic]] of the hypothesis is 3.47, corresponding to a significance level of about 0.07. In most settings, this would be considered insufficient to reject the null hypothesis: the factor is not significant.
Line 28: Line 32:
Note that the F distribution with 1 numerator degree of freedom is the t^2^ distribution, so the F statistic can be double-checked by squaring the previously-estimated t statistic on the corresponding coefficient. Note that the [[Statistics/FDistribution|F distribution]] with 1 numerator degree of freedom is the [[Statistics/HotelingsTSquaredDistribution|t-squared distribution]], so the F-statistic can be double-checked by squaring the previously-estimated t-statistic on the corresponding coefficient.
Line 39: Line 43:
The F statistic of the joint hypotheses is 8.85, corresponding to a significance level very close to 0. This is a strong basis to reject the joint null hypotheses: the variable is significant. The F-statistic of the joint hypotheses is 8.85, corresponding to a significance level very close to 0. This is a strong basis to reject the joint null hypotheses: the variable is significant.
Line 68: Line 72:
[[Stata/TestParm|testparm]]

[[https://www.stata.com/manuals/rtest.pdf|Stata manual for test]]
[[https://www.stata.com/manuals/rtest.pdf|Stata manual for -test-]]

Stata test

-test- performs Wald tests.

See also -testparm-.


Usage

As a demonstration:

. use https://www.stata-press.com/data/r18/census3
(1980 Census data by state)

. regress brate medage c.medage#c.medage i.region
[snip]

. test 3.region=0
 ( 1) 3.region = 0
      F( 1, 44) = 3.47
       Prob > F = 0.0691

The F-statistic of the hypothesis is 3.47, corresponding to a significance level of about 0.07. In most settings, this would be considered insufficient to reject the null hypothesis: the factor is not significant.

Note that the F distribution with 1 numerator degree of freedom is the t-squared distribution, so the F-statistic can be double-checked by squaring the previously-estimated t-statistic on the corresponding coefficient.

. test (2.region=0) (3.region=0) (4.region=0)
 ( 1) 2.region = 0
 ( 2) 3.region = 0
 ( 3) 4.region = 0
      F( 3, 44) = 8.85
       Prob > F = 0.0001

The F-statistic of the joint hypotheses is 8.85, corresponding to a significance level very close to 0. This is a strong basis to reject the joint null hypotheses: the variable is significant.

Expressions

Expressions are interpreted by these patterns, where a and b represent sub-expressions and 1 represents a scalar value.

  • a: hypothesis that a coefficient is equal to 0

  • a = 1: hypothesis that a coefficient is equal to a scalar value

  • a = b: hypothesis that coefficients are equal to each other

Expressions can be delimited with parentheses.

Sub-expressions can be variable names, factor indicators, or linear combinations. For example:

  • x1: variable x1

  • 2.a: factor indicator 2 of a

  • 2*x1: linear combination of a variable

  • x1+x2: linear combination of variables

If a multiple-equation model has been run, use the [equation]variable syntax to specify the hypothesis. For example, test [y1]x1=[y3]x1.


See also

Stata manual for -test-


CategoryRicottone

Stata/Test (last edited 2025-11-06 20:44:52 by DominicRicottone)