• No results found

Tests of Hypotheses for Parameters in the G( ; ) Model

In document STAT 231 Course Notes Winter (Page 162-167)

5. TESTS OF HYPOTHESES

5.2 Tests of Hypotheses for Parameters in the G( ; ) Model

and for the pricing of options, such an assumption is usually made and considered useful.

A drawback with the approach to testing described so far is that we do not have a general method for choosing the test statistic or discrepancy measure D. Often there are “intuitively obvious” test statistics that can be used; this was the case in the examples in this section. In Section 5.3 we will see how to use the likelihood function to construct a test statistic in more complicated situations where it is not always easy to come up with an intuitive test statistic.

A …nal point is that once we have speci…ed a test statistic D, we need to be able to compute the p value for the observed data. Calculating probabilities involving D brings us back to distribution theory. In most cases the exact p value is di¢ cult to determine mathematically, and we must use either an approximation or computer simulation. For- tunately, for the tests considered in Section 5.3 we can use approximations based on 2 distributions.

For the Gaussian model with unknown mean and standard deviation we use test statis- tics based on the pivotal quantities that were used in Chapter 4 for constructing con…dence intervals.

5.2

Tests of Hypotheses for Parameters in the

G( ; ) Model

Suppose that Y G( ; ) models a variate y in some population or process. A random sample Y1; : : : ; Yn is selected, and we want to test hypotheses concerning one of the two

parameters ( ; ). The maximum likelihood estimators of and 2 are

~ = Y = 1 n n P i=1 Yi and ~2 = 1 n n P i=1 (Yi Y )2:

As usual we prefer to use the sample variance estimator

S2 = 1 n 1 n P i=1 (Yi Y )2 to estimate 2.

Recall from Chapter 4 that

T = Y

S=pn v t (n 1) :

We use this pivotal quantity to construct a test of hypothesis for the parameter when the standard deviation is unknown.

156 5. TESTS OF HYPOTHESES

Hypothesis Tests for

For a Normally distributed population, we may wish to test a hypothesis H0 : = 0,

where 0 is some speci…ed value36. To do this we can use the test statistic

D = jY 0j

S=pn (5.1)

We then obtain a p value from the t distribution as follows. Let

d = jy 0j

s=pn (5.2)

be the value of D observed in a sample with mean y and standard deviation s, then

p value = P (D d; H0 is true)

= P (jT j d) = 1 P ( d T d)

= 2 [1 P (T d)] where T t (n 1) : (5.3)

One-sided hypothesis tests

The values of the parameter to be considered when H0 is not true are often described

as an alternative hypothesis which is denoted by HA. Suppose data on the e¤ects of a

new treatment follow a G( ; ) distribution and that the new treatment can either have no e¤ect represented by = 0 or a bene…cial e¤ect represented by > 0. In this example the null hypothesis is H0 : = 0 and the alternative hypothesis is HA: > 0. To test

H0 : = 0 using this alternative we could use the test statistic

D = Y 0

S=pn

so that large values of D provide evidence against H0 in the direction of the alternative

> 0. Under H0 : = 0 the test statistic D has a t (n 1) distribution. Let the

observed value be d = y 0 s=pn Then p value = P (D d; H0 is true) = P (T d) = 1 P (T d) where T t (n 1) :

In Example 5.1.2, the hypothesis of interest was H0: = 1=6 where was the probability

that the upturned face was a one. If the alternative of interest is that is not equal to 1=6

3 6Often when we test a hypothesis we have in mind an alternative, i.e. what if the hypothesis H

0 is false. In this case the alternative is 6= 0

5.2. TESTS OF HYPOTHESES FOR PARAMETERS IN THE G( ; ) MODEL 157

then the alternative hypothesis is HA : 6= 1=6 and the test statistic D = jY n=6j is a

good choice. If the alternative of interest is that is bigger than 1=6 then the alternative hypothesis is HA: > 1=6 and the test statistic D = max [(Y n=6); 0] is a better choice.

Example 5.2.1 Testing for bias in a measurement system

Two cheap scales A and B for measuring weight are tested by taking 10 weighings of a one kg weight on each of the scales. The measurements on A and B are

A : 1:026 0:998 1:017 1:045 0:978 1:004 1:018 0:965 1:010 1:000 B : 1:011 0:966 0:965 0:999 0:988 0:987 0:956 0:969 0:980 0:988

Let Y represent a single measurement on one of the scales, and let represent the average measurement E(Y ) in repeated weighings of a single 1 kg weight. If an experiment involving n weighings is conducted then a test of H0 : = 1 can be based on the test

statistic (5.1) with observed value (5.2) and 0 = 1. The samples from scales A and B above give us

A : y = 1:0061; s = 0:0230; d = 0:839 B : y = 0:9810; s = 0:0170; d = 3:534:

The p value for A is

p value = P (D 0:839; = 1)

= P (jT j 0:839) where T t (9) = 2 [1 P (T 0:839)]

= 2 [1 0:7884] t 0:42

and thus there is no evidence of bias (that is, there is no evidence against H0 : = 1) for

scale A based on the observed data. For scale B, however, we obtain

p value = P (D 3:534; = 1)

= P (jT j 3:534) where T t (9) = 2 [1 P (T 3:534)]

= 0:0064

and thus there is very strong evidence against H0 : = 1. The observed data suggest

strongly that scale B is biased.

Finally, note that just because there is strong evidence against H0for scale B, the degree

of bias in its measurements is not necessarily large enough to be of practical concern. In fact, we can get a 95% con…dence interval for for scale B by using the pivotal quantity

T = Y

158 5. TESTS OF HYPOTHESES

For T t (9) we have P (T 2:2622) = 0:975, and a 95% con…dence interval for is given by y 2:2622s=p10 = 0:981 0:012 or [0:969; 0:993]. Evidently scale B consistently un- derstates the weight but the bias in measuring the 1 kg weight is likely fairly small (about

1% 3%).

Remark: The function t.test in R will give con…dence intervals and test hypotheses about ; for a data set y use t.test(y).

Relationship between Hypothesis Testing and Interval Estimation

Suppose y1; : : : ; yn is an observed random sample from the G( ; ) distribution. Suppose

we test H0 : = 0. Now p value 0:05 if and only if P jY 0j S=pn jy 0j s=pn ; H0 : = 0 is true 0:05 if and only if P jT j jy 0j s=pn 0:05 where T t (n 1) if and only if P jT j jy 0j s=pn 0:95 if and only if jy 0j s=pn a where P (jT j a) = 0:95 if and only if 0 2 y as=pn; y + as=pn

which is a 95% con…dence interval for . In other words, the p value for testing H0 : = 0

is greater than or equal to 0:05 if and only if the value = 0 is inside a 95% con…dence interval for (assuming we use the same pivotal quantity).

More generally, suppose we have data y, a model f (y; ) and we use the same pivotal quantity to construct a con…dence interval for and a test of the hypothesis H0 : = 0.

Then the parameter value = 0 is inside a 100q% con…dence interval for if and only if

the p value for testing H0 : = 0 is greater than 1 q.

Example 5.2.1 Revisited

For the weigh scale example a 95% con…dence interval for the mean for the second scale was [0:969; 0:993]. Since = 1 is not in this interval we know that the p value for testing H0: = 1 would be less than 0:05. (In fact we showed the p value equals 0:0064

5.2. TESTS OF HYPOTHESES FOR PARAMETERS IN THE G( ; ) MODEL 159

Hypothesis tests for

Suppose that we have a sample Y1; Y2; : : : ; Yn of independent random variables each from

the same G( ; ) distribution. Recall that we used the pivotal quantity

(n 1)S2 2 = 1 2 n P i=1 (Yi Y )2s 2(n 1)

to construct con…dence intervals for the parameter . We may also wish to test a hypothesis such as H0 : = 0. One approach is to use a likelihood ratio test statistic which is

described in the next section. Alternatively we could use the test statistic

U = (n 1)S

2 2 0

for testing H0 : = 0. Large values of U and small values of U provide evidence against

H0. (Why is this?) Now U has a Chi-squared distribution when H0 is true and the

Chi-squared distribution is not symmetric which makes the determination of “large” and “small” values somewhat problematic. The following simpler calculation approximates the p value:

1. Let u = (n 1)s2= 20 denote the observed value of U from the data.

2. If u is large (that is, if P (U u) > 12) compute the p value as

p value = 2P (U u)

where U s 2(n 1).

3. If u is small (that is, if P (U u) < 12) compute the p value as

p value = 2P (U u)

where U s 2(n 1).

Figure 5.1 shows a picture for a large observed value of u. In this case P (U u) > 12 and the p value = 2P (U u).

Example 5.2.2

For the manufacturing process in Example 4.7.2, test the hypothesis H0 : = 0:008

(0:008 is the desired or target value of the manufacturer would like to achieve). Note that since the value = 0:008 is outside the two-sided 95% con…dence interval for in Example 4.5.2, the p value for a test of H0 based on the test statistic U = (n 1)S2= 20 will be

less than 0:05. To …nd the p value, we follow the procedure above:

1. u = (n 1)s2= 2

0 = (14) s2= (0:008)

160 5. TESTS OF HYPOTHESES 0 5 10 15 20 25 30 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 u P(U< u) P(U> u) p.d. f.

Figure 5.1: Picture of large observed u

2. The p value is

p value = 2P (U u) = 2P (U 36:67) = 0:0017

where U s 2(14).

There is very strong evidence against H0 : = 0:008. Since the observed value of

s =p0:002347=14 = 0:0129 is greater than 0:008, the data suggest that is bigger than 0:008.

In document STAT 231 Course Notes Winter (Page 162-167)