810 CHAPTER 39. STATISTICAL TESTS

39.2.3 Testing For Two Different MeansSuppose you have two different normal distributions and you take samples from each. Youmight ask whether the two means are different. This involves the general notion of hypoth-esis testing. First of all, there is no way you will ever know that two means are exactlyequal based on random samples from the two, but you might be able to conclude that youare very sure that the two are not equal. The following is some general terminology.

Definition 39.2.4 The hypothesis to be tested is called the null hypothesis, often denotedas H0. For example, you might have equality of two means be the null hypothesis. Rejectionof the hypothesis depends on whether some statistic, depending on the validity of H0 is ina region for which we agree to reject the hypothesis. Usually this is done based on theprobability of the statistic being in this region. The set of values for which we don’t rejectthe hypothesis is called the acceptance region.

Lemma 39.2.5 Let X ,Y be independent random variables taken from two different normaldistributions, respectively n

(µ1,σ

21)

and n(µ2,σ

22). Then X−Y is n

(µ1−µ2,σ

21 +σ2

2).

Proof: Let M (t) be the moment generating function of X−Y.

M (t) ≡ E (exp(t (X−Y ))) = E (exp(tX)exp(−tY ))

= E (exp(tX))E (exp(−tY ))

= etµ1e12 t2σ2

1e−tµ2e12 t2σ2

2 = et(µ1−µ2)e12 t2(σ2

1+σ22)

which is the moment generating function of a random variable with distribution

n(µ1−µ2,σ

21 +σ

22)

■Now suppose that {Xk}r+1

k=1 and {Yk}r+1k=1 are two random samples taken from n

(µ1,σ

21)

and n(µ2,σ

22)

respectively. Thus from Lemma 39.2.5,

Xk−Yk

is n(µ1−µ2,σ

21 +σ2

2). Letting Zk ≡ Xk−Yk, then it follows as in Lemma 39.2.1

1√r+1

r+1

∑k=1

Zk− (µ1−µ2)√σ2

1 +σ22

is n(0,1)

Then, just as before,1√r+1 ∑

r+1k=1

Zk−(µ1−µ2)√σ2

1+σ22√

∑r+1k=1(Zk−Z̄)2

r(σ21+σ2

2)

is a T random variable with parameter equal to r,T (r). As before, we can simplify this toobtain that the following is a T random variable.

√r√

r+1(Z̄− (µ1−µ2))√∑

r+1k=1 (Zk− Z̄)2

(39.4)

810 CHAPTER 39. STATISTICAL TESTS39.2.3. Testing For Two Different MeansSuppose you have two different normal distributions and you take samples from each. Youmight ask whether the two means are different. This involves the general notion of hypoth-esis testing. First of all, there is no way you will ever know that two means are exactlyequal based on random samples from the two, but you might be able to conclude that youare very sure that the two are not equal. The following is some general terminology.Definition 39.2.4 The hypothesis to be tested is called the null hypothesis, often denotedas Ho. For example, you might have equality of two means be the null hypothesis. Rejectionof the hypothesis depends on whether some statistic, depending on the validity of Ho is ina region for which we agree to reject the hypothesis. Usually this is done based on theprobability of the statistic being in this region. The set of values for which we don’t rejectthe hypothesis is called the acceptance region.Lemma 39.2.5 Let X,Y be independent random variables taken from two different normaldistributions, respectively n([1,,07) and n([ly,03). Then X —Y isn (uw, —My,07 +03).Proof: Let M (t) be the moment generating function of X —Y.M(t) = E(exp(t(X —Y))) =E (exp(tX)exp(-rY))= E(exp(tX))E (exp(—tY))eH e2t Of pty p51 05 = et (HH) 931° (07 +03)which is the moment generating function of a random variable with distributionn(Ly —[>,0, +03)aNow suppose that {Xie and {¥,}/+} are two random samples taken from n (u,,07)and n ({),03) respectively. Thus from Lemma 39.2.5,Xi — Vyisn (u, =, ot + 03). Letting Z, = X; — Y;, then it follows as in Lemma 39.2.11 OZ (uy — by)vr+1 /o? +63is n(0, 1)Then, just as before,yr Ze 1H»)Trt k=l a +3vey (ZZ)r(o[ +03)is a T random variable with parameter equal to r,T (r). As before, we can simplify this toobtain that the following is a T random variable.vrvr+ 1 (Z— (ty = My)Lith (Ze -Z)?(39.4)