The results from estimation commands display only two-sided tests for the
coefficients. How can I perform a one-sided test?

Title

One-sided tests for coefficients

Author

Kristin MacDonald, StataCorp

Date

July 2006; minor revision May 2015

Estimation commands provide a t test or z test for the null
hypothesis that a coefficient is equal to zero. The
test command
can perform Wald tests for simple and composite linear hypotheses on the
parameters, but these Wald tests are also limited to tests of equality.

One-sided t tests

To perform one-sided tests, you can first perform the corresponding
two-sided Wald test. Then you can use the results to calculate the test
statistic and p-value for the one-sided test. Let’s say that
you perform the following regression:

The Wald test given here is an F test with 1 numerator degree of
freedom and 71 denominator degrees of freedom. The Student’s t
distribution is directly related to the F distribution in that the
square of the Student’s t distribution with d degrees of
freedom is equivalent to the F distribution with 1 numerator degree
of freedom and d denominator degrees of freedom.

As long as the F test has 1 numerator degree of freedom, the square
root of the F statistic is the absolute value of the t
statistic for the one-sided test. To determine whether this t
statistic is positive or negative, you need to determine whether the fitted
coefficient is positive or negative. To do this, you can use the
sign() function.

. local sign_wgt = sign(_b[weight])

Then, using the
ttail()
function along with the returned results from the test command, you
can calculate the p-values for the one-sided tests in the following
manner:

In the special case where you are interested in testing whether a
coefficient is greater than, less than, or equal to zero, you can calculate
the p-values directly from the regression output. When the estimated
coefficient is positive, as for weight, you can do so as follows:

H0: βweight = 0

p-value = 0.008 (given in regression output)

H0: βweight <= 0

p-value = 0.008/2 = 0.004

H0: βweight >= 0

p-value = 1 − (0.008/2) = 0.996

When the estimated coefficient is negative, as for
mpg, the same code can be used:

One-sided z tests

In the output for certain estimation commands, you will find that z
statistics are reported instead of t statistics. In these cases,
when you use the test command, you will get a chi-squared test
instead of an F test. The relationship between the standard normal
distribution and the chi-squared distribution is similar to the relationship
between the Student’s t distribution and the F
distribution. In fact, the square root of the chi-squared distribution with
1 degree of freedom is the standard normal distribution. Therefore,
one-sided z tests can be performed similarly to one-sided t
tests. For example,

Again, this approach (performing a Wald test and using the results to
calculate the p-value for a one-sided test) is appropriate only when
the Wald F statistic has 1 degree of freedom in the numerator or the
Wald chi-squared statistic has 1 degree of freedom. The distributional
relationships discussed above are not valid if these degrees of freedom are
larger than 1.