1. state the null and alternative hypotheses

24
State the null and alternative hypotheses. Select a random sample and record observed frequency f i for the i th category (k categories). . Compute expected frequency e i for the i th category: Compute the value of the test statistic. if e i > 5, this has a chi-square distribution 5. Reject H 0 if df = k – 1 Goodness of Fit Test i i e np 2 2 1 ( ) -stat i k i i i e f e 2 2 -stat

Upload: wells

Post on 25-Feb-2016

45 views

Category:

Documents


0 download

DESCRIPTION

Goodness of Fit Test. 1. State the null and alternative hypotheses. 2. Select a random sample and record observed frequency f i for the i th category ( k categories ) . Compute expected frequency e i for the i th category:. 4. Compute the value of the test statistic. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 1.   State the null and alternative hypotheses

1. State the null and alternative hypotheses.2. Select a random sample and record observed frequency fi for the ith category (k categories).3. Compute expected frequency ei for the ith category:

i ie n p

4. Compute the value of the test statistic.

if ei > 5, this has a chi-square distribution

22

1

( )-stat i

k

i

i

i

efe

5. Reject H0 if 2 2-stat df = k – 1

Goodness of Fit Test

Page 2: 1.   State the null and alternative hypotheses

Goodness of Fit Test

Example: Finger Lakes Homes (A)

Finger Lakes Homes manufactures four models of prefabricated homes, a two-story colonial, a log cabin, a split-level, and an A-frame. To help in production planning, management would like to determine if previous customer purchases indicate that there is a preference in the style selected.

Split- A-Model Colonial Log Level Frame# Sold 30 20 35 15

The number of homes sold of each model for 100 sales over the past two years is shown below.

k = 4

Page 3: 1.   State the null and alternative hypotheses

1/4.25Hypotheses

Goodness of Fit Test

H0: pC = pL = pS = pA = Ha: customers prefer a particular style

ei = (n)(pi)

i.e., there is at least one proportion much greater than .25

e1 = (0.25)(100) = 25Expected

frequencies

2 2 2 225 25 25 2525 25

( ) ( ) ( )25 25

(30 20 35 1 )5 102 -stat

e2 = (0.25)(100) = 25e3 = (0.25)(100) = 25e4 = (0.25)(100) = 25

Page 4: 1.   State the null and alternative hypotheses

Goodness of Fit Test

= .05 (column)

7.815

Do Not Reject H0 Reject H0

2.05 7.815

.05 2

At 5% significance, the assumption that there is no home style preference is rejected.

2 -stat

df = 4 – 1 = 3 (row)

m = 3 10

Page 5: 1.   State the null and alternative hypotheses

1. State the null and alternative hypotheses.2. Select a random sample and record observed frequency fi for each cell of the contingency table.3. Compute expected frequency eij for each cell

(Row Total)(Column Total) ij

i jen

4. Compute the test statistic.2

2 ( )-stat ij ij

i j ij

efe

5. Reject H0 if 2 2-stat df = (m - 1)(k - 1)

Independence Test

if ei > 5, this has a chi-square distribution

Page 6: 1.   State the null and alternative hypotheses

The number of homes sold for each model and price for the past two years is shown below. For convenience, the price of the home is listed as either $99,000 or less or more than $99,000.

Each home sold by Finger Lakes Homes can be classified according to price and to style. Finger Lakes’ manager would like to determine if the price of the home and the style of the home are independent variables.

Example: Finger Lakes Homes (B)

Price Colonial Log Split-Level A-Frame

> $99,000< $99,000

k = 4

Independence Test

18 6 19 1212 14 16 3

m = 2

Page 7: 1.   State the null and alternative hypotheses

45

Price Colonial Log Split-Level A-Frame Total< $99K> $99K Total

3012 14 16 3

18 6 19 1255

Price Colonial Log Split-Level A-Frame Total< $99K> $99K Total

16.5 11 19.25

8.2513.5 9 15.7

56.75

55

30

Expected Frequencies (ei)

Observed Frequencies (fi)

Independence Test

20 35 15 100

45 20 35 15 100

Page 8: 1.   State the null and alternative hypotheses

2 2 2 22

2 2 2 2

16.5 11 19.25 8.2516.5 11 19.25 8.25

13.5 9 15.75 6.7513.5 9 15.75 6.7

18 6 19 12

12 14 16

( ) ( ) ( ) ( )-stat

( ) ( ) ( ) 3(5

)

Compute test statistic

9.145

Hypotheses

H0: Price of the home is independent of the style of the home that is purchasedHa: Price of the home is not independent of the style of the home that is purchased

Independence Test

Page 9: 1.   State the null and alternative hypotheses

= .05 (column)

7.815

Do Not Reject H0 Reject H0

2.05 7.815

.05 2

At 5% significance, we reject the assumption that the price of the home is independent of the style of home that is purchased.

2 -stat

df = (4 – 1)(2 – 1) = 3 (row)

9.145m = 3

Independence Test

Page 10: 1.   State the null and alternative hypotheses

1. Set up the null and alternative hypotheses.

3. Compute expected frequency of occurrences ei for each value of the Poisson random variable.

2. Select a random sample and a. Record observed frequencies b. Estimate mean number of occurrences m

( )!

xef xx

mm

( )i in fe x

4. Compute the value of the test statistic.2

2

1

( )-stat ik

i

i

i

efe

5. Reject H0 if 2 2-stat df = k – p – 1

Goodness of Fit Test: Poisson Distribution

Page 11: 1.   State the null and alternative hypotheses

Example: Troy Parking GarageIn studying the need for an additional entrance to a

city parking garage, a consultant has recommended an analysis approach that is applicable only in situations where the number of cars entering during a specified time period follows a Poisson distribution.

Goodness of Fit Test: Poisson Distribution

A random sample of n = 100 one-minute time intervals resulted in the customer arrivals listed below. A statistical test must be conducted to see if the assumption of a Poisson distribution is reasonable.

# of Arrivals 0 1 2 3 4 5 6 7 8 9 10 11 12Frequency 0 1 4 10 14 20 12 12 9 8 6 3 1

otal Arrivals = 0(0) + 1(1) + 2(4) + 3(10) + . . . + 12(1) = 600

Estimate of m = 600/100 = 6Total one-minute intervals = n = 0 + 1 + 4 + 10 + . . . + 1 = 100

Page 12: 1.   State the null and alternative hypotheses

66( )!

x ef xx

0 660!e

x f (x ) n∙ f (x )012345

16.0613.7710.336.888.39

0.16060.1377

0.1033 0.0688

6 7 8 910+

0.0025 0.25

x f (x ) n∙ f (x )

1.0000 100.00

For x = 0 1

0.01490.04460.08920.13390.1606

1.494.468.92

13.3916.06

611e

0.0025(0)f (1)f1 661!e

66

1e

0.0149

Goodness of Fit Test: Poisson Distribution

The hypothesized probability of x cars arriving during the time period is

0.0839

Page 13: 1.   State the null and alternative hypotheses

i fi ei fi - ei

-1.20 1.08 0.61 3.94-4.06-1.77-1.33 1.12 1.61

6.20 8.9213.3916.0616.0613.7710.33 6.88 8.39

51014201212 9 810

0 or 1 or 2 3 4 5 6 7 8 910 or more

Goodness of Fit Test: Poisson Distribution

2 2 2

2 ( 1.20) (1.08) (1.61)-stat . . 6 ..20 8.92 8.39 3.274

Page 14: 1.   State the null and alternative hypotheses

With = .05

14.067

Do Not Reject H0 Reject H0

2.05 14.067

.05 2

At 10% significance, there is no reason to doubt the assumption of a Poisson distribution.

3.274

(column) and df = 7 (row)

Goodness of Fit Test: Poisson Distribution

Page 15: 1.   State the null and alternative hypotheses

1. State the null and alternative hypotheses.

3. Compute ei for each interval.

2. Select a random sample anda. Compute the mean and standard deviation (p = 2).b. Define intervals so that ei > 5 is in the ith intervalc. For each interval, record observed frequencies fi

22

1

( )-stat i

k

i

i

i

efe

4. Compute the value of the test statistic.

2 2-stat5. Reject H0 if df = k – p – 1

if ei > 5, this has a chi-square distribution

Goodness of Fit Test: Normal Distribution

Page 16: 1.   State the null and alternative hypotheses

Example: IQ Computers

IQ Computers (one better than HP?) manufactures and sells a general purpose microcomputer. As part of a study to evaluate sales personnel, management wants to determine, at a 5% significance level, if the annual sales volume (number of units sold by a salesperson) follows a normal probability distribution.

A simple random sample of 33 of the salespeople was taken and their numbers of units sold are below.

33 43 44 45 52 52 56 58 63 63 6464 65 66 68 70 72 73 73 74 74 7583 84 85 86 91 92 94 98 101 102 105

n = 33, x = 71.76, s = 18.47

Goodness of Fit Test: Normal Distribution

Page 17: 1.   State the null and alternative hypotheses

z.

k = 33/5 = 6.6 6 equal intervals.

To ensure the test statistic has a chi-square distribution, the normal distribution is divided into k intervals.

Expected frequency: ei = 33/6 = 5.5

1/6 = .1667

The probability of being in each

interval is equal to

Goodness of Fit Test: Normal Distribution

Page 18: 1.   State the null and alternative hypotheses

= (1)(.1667) = .1667

z.– .97 .1667

Find the z that corresponds to the red tail probability

Goodness of Fit Test: Normal Distribution

Page 19: 1.   State the null and alternative hypotheses

= .3333

–.43

.3333

z.

Goodness of Fit Test: Normal Distribution

Find the z that corresponds to the red tail probability

= (2)(.1667)

Page 20: 1.   State the null and alternative hypotheses

= .5000

0

.5000

z.

Goodness of Fit Test: Normal Distribution

= (3)(.1667)

Find the z that corresponds to the red tail probability

Page 21: 1.   State the null and alternative hypotheses

0

.97 .43 z.–.97 –.43

Goodness of Fit Test: Normal Distribution

Find the remaining z values using symmetry

Page 22: 1.   State the null and alternative hypotheses

.471.76 ( )(18.473 )x 071.76 ( )(18.47)x .4371.76 ( )(18.47)x .9771.76 ( )(18.47)x

( )( )sz x x ( )( )zx x s

.971.76 ( )(18.477 )x

z x xs

53.84 63.81 71.76 79.70 89.68

Convert the z’s to x’s

xz. 0 .97 .43–.97 –.43

Goodness of Fit Test: Normal Distribution

Find the z that corresponds to the red tail probability

Page 23: 1.   State the null and alternative hypotheses

33 43 44 45 52 52 56 58 63 63 6464 65 66 68 70 72 73 73 74 74 7583 84 85 86 91 92 94 98 101 102 105

Observed and Expected Frequencies

0.5-1.5 0.5 0.5-1.5 1.5

5.55.55.55.55.55.533

6

fi ei fi – ei (fi – ei)2/ei

Total

LL UL53.8463.8171.7679.7089.68 ∞

46647

33

Data Table

∞53.8463.8171.7679.7089.68

0.050.410.050.050.410.411.362 -stat

Goodness of Fit Test: Normal Distribution

Page 24: 1.   State the null and alternative hypotheses

= .05 (column)

7.815

Do Not Reject H0 Reject H0

.05 2

At 5% significance, there is no reason to doubt the

assumption that the population is normally

distributed.

2 -stat

df = 3 (row) 2.05 7.815

1.36 m = 3

Goodness of Fit Test: Normal Distribution