27
Tests on Means and Variances of a Normal distribution Large Samples Tests on Means Testing Equality of Means – Paired Samples Hypothesis Testing – Two Samples Tests Jiˇ ı Neubauer Department of Econometrics FVL UO Brno office 69a, tel. 973 442029 email:[email protected] Jiˇ ı Neubauer Hypothesis Testing – Two Samples Tests

Hypothesis Testing Two Samples Tests - unob.czk101.unob.cz/~neubauer/pdf/Hypothesis_test3.pdf · Tests on Means and Variances of a Normal distribution Large Samples Tests on Means

Embed Size (px)

Citation preview

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Hypothesis Testing – Two Samples Tests

Jirı Neubauer

Department of Econometrics FVL UO Brnooffice 69a, tel. 973 442029

email:[email protected]

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Variances

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22).

S2X and S2

Y are corresponding sample variances.

The statistic

F =S2X

S2Y

· σ22

σ21

has a Fisher-Snedecor distribution with ν1 = n − 1 and ν2 = n2 − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Variances

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22).

S2X and S2

Y are corresponding sample variances.The statistic

F =S2X

S2Y

· σ22

σ21

has a Fisher-Snedecor distribution with ν1 = n − 1 and ν2 = n2 − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Variances

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21),

y1, y2, . . . , yn2 be values of a random sample from N(µ2, σ22),

s2x and s2

y corresponding values of sample variances.

We test a hypothesis that the parametr σ21 is equal to the parameter σ2

2 :

H : σ21 = σ2

2 ,

the test statistic is

F =s2x

s2y

,

which has under the null hypothesis H a Fisher-Snedecor distributionwith ν1 = n1 − 1 and ν2 = n2 − 1 degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Variances

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21),

y1, y2, . . . , yn2 be values of a random sample from N(µ2, σ22),

s2x and s2

y corresponding values of sample variances.

We test a hypothesis that the parametr σ21 is equal to the parameter σ2

2 :

H : σ21 = σ2

2 ,

the test statistic is

F =s2x

s2y

,

which has under the null hypothesis H a Fisher-Snedecor distributionwith ν1 = n1 − 1 and ν2 = n2 − 1 degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Variances

According to the alternative hypothesis we construct following regions ofrejection:

alternative hypothesis rejection region

A : σ21 > σ2

2 Wα = {F ,F ≥ F1−α(ν1, ν2)}

A : σ21 < σ2

2 Wα = {F ,F ≤ Fα(ν1, ν2)}

A : σ21 6= σ2

2 Wα ={F ,F ≤ Fα

2(ν1, ν2) ∨ F ≥ F1−α

2(ν1, ν2)

}where Fα(ν1, ν2), F1−α(ν1, ν2), Fα

2(ν1, ν2), F1−α

2(ν1, ν2) are quantiles of the

Fisher-Snedecor distribution, ν1 = n1 − 1, ν2 = n2 − 1.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 = σ2

2)

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22). We assume that

these random samples are independent.

X , Y , S2X a S2

Y are corresponding sample means and variances. Ifσ2

1 = σ22 , then a statistic

T =X − Y − (µ1 − µ2)

S

√n1 · n2

n1 + n2,

where

S =

[(n1 − 1)S2

X + (n2 − 1)S2Y

n1 + n2 − 2

]1/2

(it is co called pooled estimator of the common σ) has a Studentdistribution with ν = n1 + n2 − 2 degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 = σ2

2)

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22). We assume that

these random samples are independent.

X , Y , S2X a S2

Y are corresponding sample means and variances. Ifσ2

1 = σ22 , then a statistic

T =X − Y − (µ1 − µ2)

S

√n1 · n2

n1 + n2,

where

S =

[(n1 − 1)S2

X + (n2 − 1)S2Y

n1 + n2 − 2

]1/2

(it is co called pooled estimator of the common σ) has a Studentdistribution with ν = n1 + n2 − 2 degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 = σ2

2)

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21), y1, y2, . . . , yn2

be values of a random sample from N(µ2, σ22)

x , y , s2x a s2

y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2

(σ21 = σ2

2):H : µ1 = µ2,

a test statistic is

t =x − y

S

√n1 · n2

n1 + n2,

where

S =

[(n1 − 1)s2

x + (n2 − 1)s2y

n1 + n2 − 2

]1/2

has under the null hypothesis H the Student distribution with ν = n1 + n2 − 2

degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 = σ2

2)

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21), y1, y2, . . . , yn2

be values of a random sample from N(µ2, σ22)

x , y , s2x a s2

y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2

(σ21 = σ2

2):H : µ1 = µ2,

a test statistic is

t =x − y

S

√n1 · n2

n1 + n2,

where

S =

[(n1 − 1)s2

x + (n2 − 1)s2y

n1 + n2 − 2

]1/2

has under the null hypothesis H the Student distribution with ν = n1 + n2 − 2

degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 = σ2

2)

According to the alternative hypothesis we construct following regions ofrejection:

alternative hypothesis rejection region

A : µ1 > µ2 Wα = {t, t ≥ t1−α(ν)}

A : µ1 < µ2 Wα = {t, t ≤ −t1−α(ν)}

A : µ1 6= µ2 Wα ={t, |t| ≥ t1−α

2(ν)}

where t1−α(ν), t1−α2(ν) are quantiles of the Student distribution,

ν = n1 + n2 − 2.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22). We assume that

these random samples are independent.

X , Y , S2X a S2

Y are corresponding sample means and variances. Ifσ2

1 = σ22 , then a statistic

T =X − Y − (µ1 − µ2)√

S2X

n1+

S2Y

n2

,

has approximately a Student distribution with ν degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

Let X1,X2, . . . ,Xn1 be a random sample from N(µ1, σ21) and

Y1,Y2, . . . ,Yn2 be a random sample from N(µ2, σ22). We assume that

these random samples are independent.

X , Y , S2X a S2

Y are corresponding sample means and variances. Ifσ2

1 = σ22 , then a statistic

T =X − Y − (µ1 − µ2)√

S2X

n1+

S2Y

n2

,

has approximately a Student distribution with ν degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21),

y1, y2, . . . , yn2 be values of a random sample from N(µ2, σ22)

x , y , s2x a s2

y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2

(σ21 6= σ2

2):H : µ1 = µ2,

a test statistic

t =x − y√s2x

n1+

s2y

n2

,

has under the null hypothesis H approximately a Student distributionwith ν degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

Let x1, x2, . . . , xn1 be values of a random sample from N(µ1, σ21),

y1, y2, . . . , yn2 be values of a random sample from N(µ2, σ22)

x , y , s2x a s2

y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2

(σ21 6= σ2

2):H : µ1 = µ2,

a test statistic

t =x − y√s2x

n1+

s2y

n2

,

has under the null hypothesis H approximately a Student distributionwith ν degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

Degrees of freedom are given by a formula

ν ≈

(s2x

n1+

s2y

n2

)2

1n1−1

(s2x

n1

)2

+ 1n2−1

(s2y

n2

)2

rounded down to the nearest integer number.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of VariancesTesting Equality of Means (σ2

1 = σ22 )

Testing Equality of Means (σ21 6= σ2

2 )

Testing Equality of Means (σ21 6= σ2

2)

According to the alternative hypothesis we construct following regions ofrejection:

alternative hypothesis rejection region

A : µ1 > µ2 Wα = {t, t ≥ t1−α(ν)}

A : µ1 < µ2 Wα = {t, t ≤ −t1−α(ν)}

A : µ1 6= µ2 Wα ={t, |t| ≥ t1−α

2(ν)}

where t1−α(ν), t1−α2(ν) are quantiles of the Student distribution with

ν degrees of freedom (see the previous page).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Large Samples

Let X1,X2, . . . ,Xn1 be a random sample from a distribution with themean µ1 and Y1,Y2, . . . ,Yn2 be a random sample from a distributionwith the mean µ2. We assume that these random samples areindependent and samples are large enough.

X , Y , S2X a S2

Y are corresponding sample means and variances. A statistic

U =X − Y − (µ1 − µ2)√

S2X

n1+

S2Y

n2

,

has approximately a normal distribution N(0, 1).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Large Samples

Let X1,X2, . . . ,Xn1 be a random sample from a distribution with themean µ1 and Y1,Y2, . . . ,Yn2 be a random sample from a distributionwith the mean µ2. We assume that these random samples areindependent and samples are large enough.

X , Y , S2X a S2

Y are corresponding sample means and variances. A statistic

U =X − Y − (µ1 − µ2)√

S2X

n1+

S2Y

n2

,

has approximately a normal distribution N(0, 1).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Large Samples

Let x1, x2, . . . , xn1 are values of a random sample from the firstdistribution, y1, y2, . . . , yn2 are values of a random sample from thesecond distribution,x , y , s2

x and s2y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2:

H : µ1 = µ2,

a test statistic

u =x − y√s2x

n1+

s2y

n2

,

has under the null hypothesis H approximately a normal distributionN(0, 1).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Large Samples

Let x1, x2, . . . , xn1 are values of a random sample from the firstdistribution, y1, y2, . . . , yn2 are values of a random sample from thesecond distribution,x , y , s2

x and s2y are corresponding values of sample means and variances.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2:

H : µ1 = µ2,

a test statistic

u =x − y√s2x

n1+

s2y

n2

,

has under the null hypothesis H approximately a normal distributionN(0, 1).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Large Samples

According to the alternative hypothesis we construct following regions ofrejection:

alternative hypothesis rejection region

A : µ1 > µ2 Wα = {u, u ≥ u1−α}

A : µ1 < µ2 Wα = {u, u ≤ −u1−α}

A : µ1 6= µ2 Wα ={u, |u| ≥ u1−α

2

}where u1−α, u1−α

2are quantiles of N(0, 1).

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Paired Samples

Let us have two dependent samples, two data values – one for eachsample – are collected from some source (or element). These are alsocalled paired or matched samples. We assume two dependent randomvariables X and Y with means µ1 and µ2, the difference D = X − Y isa random variable too. Let D1,D2, . . . ,Dn be a random sample, wheredifferences Di = Xi − Yi have a normal distribution N(µ, σ2), whereµ = µ1 − µ2 (σ2 is not needed).

A statistic

T =D − µSD

√n,

where D is a sample mean of differences and SD is a sample standarddeviation of differences, has a Student distribution with ν = n − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Paired Samples

Let us have two dependent samples, two data values – one for eachsample – are collected from some source (or element). These are alsocalled paired or matched samples. We assume two dependent randomvariables X and Y with means µ1 and µ2, the difference D = X − Y isa random variable too. Let D1,D2, . . . ,Dn be a random sample, wheredifferences Di = Xi − Yi have a normal distribution N(µ, σ2), whereµ = µ1 − µ2 (σ2 is not needed).A statistic

T =D − µSD

√n,

where D is a sample mean of differences and SD is a sample standarddeviation of differences, has a Student distribution with ν = n − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Paired Samples

Let d1 = x1 − y1, d2 = x2 − y2, . . . , dn = xn − yn be measure valued ofdifferences, d is its sample mean and sd is its sample standard deviation.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2:

H : µ1 = µ2,

a test statistic

t =d

sd

√n,

has under the null hypothesis H a Student distribution with ν = n − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Paired Samples

Let d1 = x1 − y1, d2 = x2 − y2, . . . , dn = xn − yn be measure valued ofdifferences, d is its sample mean and sd is its sample standard deviation.

We test a hypothesis that the parameter µ1 is equal to the parameter µ2:

H : µ1 = µ2,

a test statistic

t =d

sd

√n,

has under the null hypothesis H a Student distribution with ν = n − 1degrees of freedom.

Jirı Neubauer Hypothesis Testing – Two Samples Tests

Tests on Means and Variances of a Normal distributionLarge Samples Tests on Means

Testing Equality of Means – Paired Samples

Testing Equality of Means – Paired Samples

According to the alternative hypothesis we construct following regions ofrejection:

alternative hypothesis rejection region

A : µ1 > µ2 Wα = {t, t ≥ t1−α(ν)}

A : µ1 < µ2 Wα = {t, t ≤ −t1−α(ν)}

A : µ1 6= µ2 Wα ={t, |t| ≥ t1−α

2(ν)}

where t1−α(ν), t1−α2(ν) are quantiles of the Student distribution, ν = n − 1.

Jirı Neubauer Hypothesis Testing – Two Samples Tests