# Hypothesis Tests

Based on the soft drink example explored in section 8.7, suppose you want to test the hypothesis that the Coke and Pepsi displays have an equal but opposite effect on the probability of buying Coke. If a store has both displays, the net effect on Coke purchases is zero.

The model is:

Pr(Cokei = 1) = Ф(ві + e2pratio + fi3disp_coke + P4disp. pepsi) (16.6)

The null and alternative hypotheses are:

Ho : вз – в4 = 0 Hі : вз – в4 = 0

The simplest thing to do is use the restrict statement as shown below:

1 open "@gretldirdatapoecoke. gdt"

2 list x = pratio disp_coke disp_pepsi const

3 probit coke x

4 restrict

5 b+b=0

6 end restrict

This works exactly as it did in linear regression. The outcome in gretl is:

Restriction:

b[disp_pepsi] + b[disp_coke] = 0 Test statistic: chi"2(1) = 5.40401, with p-value = 0.0200905

The p-value is less than 5% and the hypothesis is rejected at this level.

Another hypothesis to consider is that the displays have no effect. The null and alternative hypotheses are:

H0 : в3 = 0 and в4 = 0 H1 : в3 = 0 or в4 = 0 (16.8)

The gretl code is

1 open "@gretldirdatapoecoke. gdt"

2 list x = pratio disp_coke disp_pepsi const

3 probit coke x

4 restrict

5 b=0

6 b=0

7 end restrict

This statistic will have an distribution if the null hypothesis is true. The outcome in gretl is:

Restriction set 1: b[disp_pepsi] = 0 2: b[disp_coke] = 0

Test statistic: chi"2(2) = 19.4594, with p-value = 5.9489e-005

Again, this hypothesis is rejected at any reasonable level of significance.

Since probit and logit are estimated via maximum likelihood, you can also perform a likelihood ratio test. The likelihood ratio is

LR = 2(ln Lu — ln Lr) ~ xJ (16.9)

if the null is true. The parameter J is the degrees of freedom for the x2 and it equals the number of hypotheses you are testing, in this case 2. It has the same approximate distribution as the preceding test. Lu and LR are the maximized log-likelihoods from an unrestricted and restricted model, respectively. The key is to estimate restricted and unrestricted models and collect the log-likelihood from each. For the first hypothesis, the restriction implies that

Pcoke = Ф(ві + e2pratio + e4(disp-pepsi — disp-cohe) (16.10)

To estimate the restricted model, just form the new variable (disp-pepsi — disp-cohe) and use it in the model. The script to compute and evaluate the LR is:

1 scalar c_p = disp_pepsi-disp_coke

2 probit coke x # unrestricted model

3 scalar llu = \$lnl

4 probit coke const pratio c_p # restricted model

5 scalar llr = \$lnl

6 scalar lr = 2*(llu-llr)

7 pvalue X 1 lr

The result is

Generated scalar lr = 5.42183

Chi-square(1): area to the right of 5.42183 = 0.0198865 (to the left: 0.980114)

The statistic is 5.42, which is very close to the value from the previous test of this hypothesis.