# Hypothesis Tests

Hypothesis testing allows us to confront any prior notions we may have about the model with what we actually observe. Thus, if before drawing a sample, I believe that autonomous weekly food expenditure is no less than $40, then once the sample is drawn I can determine via a hypothesis test whether experience is actually consistent with this belief.

In section 3.4 of your textbook the authors test several hypotheses about fi2. In 3.4.1a the null hypothesis is that в2 = 0 against the alternative that it is positive (i. e., в2 > 0). The test statistic is:

t = (b2 – 0)/se(b2) ~ t38 (3.2)

provided that ft2 = 0 (the null hypothesis is true). Select a = 0.05 which makes the critical value for the one sided alternative (в2 > 0) equal to 1.686. The decision rule is to reject H0 in favor of the alternative if the computed value of your t-statistic falls within the rejection region of your test; that is if it is larger than 1.686.

The information you need to compute t is contained in the least squares estimation results produced by gretl:

Model 1: OLS, using observations 1-40

Dependent variable: food_exp

Std. Error t-ratio p-value

43.4102 1.9216 0.0622

2.09326 4.8774 0.0000

Mean dependent var |
283.5735 |
S. D. dependent var |
112.6752 |

Sum squared resid |
304505.2 |
S. E. of regression |
89.51700 |

R2 |
0.385002 |
Adjusted R2 |
0.368818 |

F(1, 38) |
23.78884 |
P-value(F) |
0.000019 |

Log-likelihood |
-235.5088 |
Akaike criterion |
475.0176 |

Schwarz criterion |
478.3954 |
Hannan-Quinn |
476.2389 |

The computations

t = (b2 – 0)/se(b2) = (10.21 – 0)/2.09 = 4.88 (3.3)

Since this value falls within the rejection region, then there is enough evidence at the 5% level of significance to convince us that the null hypothesis is incorrect; the null hypothesis rejected at this level of significance.

We can use gretl to get the p-value for this test using the Tools pull-down menu. In this dialog, you have to fill in the degrees of freedom for your t-distribution (38), the value of b2 (10.21), its value under the null hypothesis-something gretl refers to as ‘mean’ (0), and the estimated standard error from your printout (2.09). This will yield the information:

t(38): area to the right of 4.88 = 9.65032e-006 (two-tailed value = 1.93006e-005; complement = 0.999981)

This indicates that the area in one tail is almost zero. The p-value is well below the usual level of significance, a = .05, and the hypothesis is rejected.

Gretl also includes a programming command that will compute p-values from several distributions. The pvalue function works similarly to the critical function discussed in the preceding section. The syntax is:

scalar p = pvalue(distribution, parameters, xval)

The pvalue function computes the area to the right of xval in the specified distribution. Choices include z for Gaussian, t for Student’s t, X for chi-square, F for F, G for gamma, B for binomial, P for Poisson, W for Weibull, or E for generalized error. The argument parameters refers to the distribution’s known parameters, as in its degrees of freedom. So, for this example try

1 open "@gretldirdatapoefood. gdt"

2 ols food_exp const income

3 scalar t2 = ($coeff(income)-0)/$stderr(income)

4 scalar p2 = pvalue(t,$df, t2)

The result is 9.72931e-006, which is very close to the value produced by the dialog box. This values differ because the value in the dialog box was rounded to 4.88 whereas the computed value here has many more significant digits to use in the computation.

In the next example, the authors of POE4 test the hypothesis that ft2 = 5.5 against the alternative that ft2 > 5.5. The computations

t = (b2 – 5.5)/se(b2) = (10.21 – 5.5)/2.09 = 2.25 (3.4)

The significance level in this case is chosen to be 0.01 and the corresponding critical value can be found using a tool found in gretl. The Tools>Statistical tables pull-down menu bring up the dialog found in Figure 3.1.

This result is found in Figure 3.8. The 0.01 one-sided critical value is 2.42857. Since 2.25 is less

than this, we cannot reject the null hypothesis at the 1% level of significance.

In section 3.4.2 of POE4, the authors conduct a one-sided test where the rejection region falls within the left tail of the t-distribution. The null hypothesis is ft2 = 15 and the alternative is < 15. The test statistic and distribution is

t = (b2 – 15)/se(b2) ~ t38 (3.5)

provided that ft2 = 15. The computation is

t = (b2 – 15)/se(fc) = (10.21 – 15)/2.09 = -2.29 (3.6)

Based on the desired level of significance, a = 0.05, we would reject the null in favor of the one-sided alternative if t < -1.686. It is and therefore we conclude that the coefficient is less than 15 at this level of significance.

In section 3.4.3 of POE4 examples of two-tailed tests are found. In the first example the economic hypothesis that households will spend $7.50 of each additional $100 of income on food. So, H0 : в2 = 7.50 and the alternative is H1 : в2 = 7.50. The statistic is t = (b2 – 7.5)/se(b2) ~ t38 if Ho is true which is computed t = (b2 – 7.5)/se(b2) = (10.21 – 7.5)/2.09 = 1.29. The two-sided, a = 0.05 critical value is 2.024. This means that you reject H0 if either t < -2.024 or if t > 2.024. The computed statistic is neither, and hence we do not reject the hypothesis that в2 is $7.50. There simply isn’t enough information in the sample to convince us otherwise.

You can draw the same conclusions from using a confidence interval that you can from this two-sided t-test. The 100(1 – a)% confidence interval for в2 is

b2 – tcse(b2) < в2 < b2 + tcse(b2) (3.7)

In terms of the example the compute interval is

10.21 – 2.024(2.09) < fi2 < 10.21 + 2.024(2.09) (3.8)

which as we saw earlier in the manual is 5.97 < ft2 < 14.45. From a hypothesis testing standpoint, you would not be able to reject the hypothesis that ft2 is different from 7.5 at the 5% level of significance because 7.5 falls within this interval.

In the next example a test of the overall significance of f32 is conducted. As a matter of routine, you always want to test to see if your slope parameter is different from zero. If not, then the variable associated with it may not belong in your model. So, H0 : ft2 = 0 and the alternative is Hi : в2 = 0. The statistic is t = (b2 — 0)/se(b2) ~ t38, if H0 is true, and this is computed t = (b2 — 0)/se(b2) = (10.21 — 0)/2.09 = 4.88. Once again, the two-sided, a = 0.05 critical value is 2.024 and 4.88 falls squarely within the 5% rejection region of this test. These numbers should look familiar since this is the test that is conducted by default whenever you run a regression in gretl.

As we saw earlier, gretl also makes obtaining one – or two-sided p-values for the test statistics you compute very easy. Simply use p-value finder dialog box available from the Tools pull-down menu (see Figure 3.8) to obtain one or two sided p-values.

## Leave a reply