Top Banner
Learning Objectives Understand how to test a hypothesis about a single population parameter: Proportion (using z-statistic) Variance (using c 2 -statistic) Calculate the probability of Type II error when failing to reject the null hypothesis Test hypotheses and construct confidence intervals about the difference in two population means using the Z statistic. Test hypotheses and construct confidence intervals about the difference in two population means using the t statistic.
58

Statr session 17 and 18 (ASTR)

Nov 01, 2014

Download

Education

RuruChowdhury

Praxis Weekend Business Analytics
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Statr session 17 and 18 (ASTR)

Learning Objectives• Understand how to test a hypothesis about a single

population parameter:– Proportion (using z-statistic)– Variance (using c2-statistic)

• Calculate the probability of Type II error when failing to reject the null hypothesis

• Test hypotheses and construct confidence intervals about the difference in two population means using the Z statistic.

• Test hypotheses and construct confidence intervals about the difference in two population means using the t statistic.

Page 2: Statr session 17 and 18 (ASTR)

Learning Objectives (continued)

• Test hypotheses and construct confidence intervals about the difference in two related populations.

• Test hypotheses and construct confidence intervals about the differences in two population proportions.

Page 3: Statr session 17 and 18 (ASTR)

Hypothesis Test of p

Suppose a company held 26% of market share for several years. Due to a massive marketing effort and improved product quality, company officials believe that the market share has increased, and they want to prove it statistically. In a random sample of 140 users, 48 used their product. Does this present evidence that their market share has increased? Test it at the 5% level of significance.

Page 4: Statr session 17 and 18 (ASTR)

Hypothesis Test of p1 – Establish the null and alternative hypotheses

H0: p = 0.26 vs. Ha: p > 0.262 – Determine the appropriate statistical test:• Z-test for proportions:

• Appropriate if the following two conditions are met: The sample was randomly selected from the

population np>= 5 and nq >=5. For our data, 140(0.26) = 36.4 > 5

and 140 (0.74) = 103.6 > 5, so this condition is met.3 – Set a, the Type I error rate / significance level

Choose the common value of a = 0.05

npq

ppz ˆ

Page 5: Statr session 17 and 18 (ASTR)

Hypothesis Test of p

4 – Establish the decision ruleCritical value method: Reject H0 if z > zc = 1.645P-value method: Reject H0 if p-value < a = 0.05

5 – Gather sample data and calculate = 48/140 = 0.343

6 – Analyze the data

24.2037.0083.0

140)26.01)(26.0(

26.0343.0ˆ

npq

ppz

Page 6: Statr session 17 and 18 (ASTR)

Hypothesis Test of A small business has 37 employees. Because of the uncertain demand for its product, the company usually pays overtime on any given week. The company assumed that about 50 total hours of overtime per week is required and that the variance on this figure is about 25. Company officials want to know whether the variance of overtime hours has changed. The data below are a random sample of 16 weeks of overtime in hours per week. Assume hours of overtime are normally distributed. Use these data to test the null hypothesis that the variance of overtime data is 25.

57 56 52 4446 53 44 4448 51 55 4863 53 51 50

Page 7: Statr session 17 and 18 (ASTR)

Hypothesis Test of

Step 1: Hypothesize

Step 2: Variances follow a chi-squared distribution with n -1 degrees of freedom, underlying population has a normal distribution. The test statistic is:

H0: 2 = 25Ha: 2 25

2

2)1(21 sn

n

Page 8: Statr session 17 and 18 (ASTR)

Hypothesis Test of

• Step 3: Choose = 0.10 (so /2 = 0.05)

• Step 4: The degrees of freedom are 16 – 1 = 15.

The lower and upper critical chi-square values are 2(1

– 0.05), 15 = 2 0.95, 15 = 7.3 and 2

0.05, 15 = 25.0

• Step 5: The data are listed in the text.

• Step 6: The sample variance is s2 = 28.1.

The observed chi-square value is calculated as

2 = (n-1)s2 / s2 = (15) 28.1 / 25 = 16.9

Page 9: Statr session 17 and 18 (ASTR)

Hypothesis Test of • Step 7: The observed chi-square value is in the

nonrejection region because 2

0.95, 15 = 7.3 < 2observed = 16.9 < 2

0.05, 15 = 25.0

• Step 8: This result indicates to the company managers that the variance of weekly overtimehours is about what they expected.

Page 10: Statr session 17 and 18 (ASTR)

Hypothesis Test of : Tails of 2 Distribution Curve

0

7.3

.95

25.0

.05

.05

df = 7

Page 11: Statr session 17 and 18 (ASTR)

Solving for Type II Errors

• When the null hypothesis is not rejected, then either a correct decision is made or an incorrect decision is made.

• If an incorrect decision is made, that is, if the null hypothesis is not rejected when it is false, then a Type II error has occurred.

Page 12: Statr session 17 and 18 (ASTR)

Solving for Type II Errors (Soft Drink)

• Suppose a test is conducted on the following hypotheses about the amount of liquid in a 12 ounce soft drink can: H0: = 12 ounces vs. Ha: < 12 ounces, the sample size is 60, and the sample mean is 11.985, and population standard deviation (s) is assumed to be 0.10.

• The first step in determining the probability of a Type II error is to calculate a critical value for the sample mean (or proportion or variance, etc.).

Page 13: Statr session 17 and 18 (ASTR)

Solving for Type II Errors (Soft Drink)

In testing the null hypothesis by the critical value method, this value is used as the cutoff for the nonrejection region. For any sample mean obtained that is less than 11.979, the null hypothesis is rejected. Any sample mean greater than 11.979, the null hypothesis is not rejected.

979.11

60/10.0

12645.1

/

cx

cx

ncx

cz

Page 14: Statr session 17 and 18 (ASTR)

Solving for Type II Errors (Soft Drink)The Type II Error rate (b) varies with different values of the true parameter. For example, if the true mean as 11.99, the corresponding z-value for b is

85.0

60/10.0

99.11979.11

/1

1

1

1

z

z

ncx

z

Page 15: Statr session 17 and 18 (ASTR)

Solving for Type II Errors (Soft Drink)• Recall that a Type II error is made when you fail to reject

when you should. Thus, you want to calculate

• Thus, there is an 80.2% chance of committing a Type II error if the alternative mean is 11.99. That is quite a high chance of being wrong (but then again 11.99 is so close to 12, so you would need a lot of data to show that those are statistically different).

• Note, you only need to be concerned about type II errors since you would have failed to reject the null hypothesis [t = -1.16 > tc = -1.645 (for a=0.05)]

802.)85.0(99.11|979.11| 1 zPxPxxP c

Page 16: Statr session 17 and 18 (ASTR)

Operating Characteristic and Power Curve

• Because the probability of committing a Type II error changes for each different value of the alternative parameter, it is common to examine a series of possible alternative values.

• The power of a test is the probability of rejecting the null hypothesis when it is false.

• Power = 1 - .

Page 17: Statr session 17 and 18 (ASTR)

Hypothesis Testing of Two Populations: Difference in Means using z Statistic ( Known)

• Calculating two sample means and using the difference in the two sample means is used to test the difference in the population

• The Central Limit theorem states that the difference in two sample means is normally distributed for large sample sizes (both n1 and n2 > 30) regardless of the shape of the population

Page 18: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

As an example, we want to conduct a hypothesis test to determine whether the average annual wage for an advertising manager is different from the average annual wage of an auditing manager. Because we are testing to determine whether the means are different, it might seem logical that the null and alternative hypotheses would beHo: μ1 = μ2

Ha: μ1 ≠ μ2

where advertising managers are Population 1 and auditing managers are Population 2.

Page 19: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

21

21

::0

aHH

=0.05, /2 = 0.025, z0.025 = 1.96

The two hypotheses can also be expressed as:

1 2

1 2

0 0:: 0a

HH

Analysis is testing whether there is a difference in the average wage. This is a two tailed test.

Page 20: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

Rejection Region

Non Rejection Region

Critical Values

Rejection Region

96.1Zc 0 96.1Zc

025.2

Rejection Region

Rejection Region

025.2

.Hz

.Hzz

o

o

reject not do 1.96, 1.96- If

reject 1.96, > or 1.96- < If

Page 21: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

164.264

253.16

700.70

32

2

1

1

1

1

xn

411.166

900.12

187.62

34

2

2

2

2

2

xn

Page 22: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

35.2

34

411.166

32

160.264)0()187.62700.70(

z

Since the observed value of 2.35 is greater than 1.96, reject the null hypothesis. That is, there is a significant difference between the average annual wage of advertising managers and the average annual wage of auditing managers.

Page 23: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

1 2X X

Rejection Region

Non Rejection Region

Critical Values

Rejection Region

1 2X X

025.2

025.

2

H

H

o

a

:

:

1 2

1 2

0

0

m mm m

- =

- ¹

Page 24: Statr session 17 and 18 (ASTR)

Hypothesis Testing for DifferencesBetween Means: The Wage Example

Rejection Region

Non Rejection Region

Critical Values

Rejection Region

cZ 2 33.

025.2

0 cZ 2 33.

025.2

.reject not do ,96.196.1 If

.reject ,96.1or 96.1 If

0

0

Hz

Hzz

35.2

34

411.166

32

164.264

(0)-62.187)-(70.700

()(

2

22

1

21

)2121

nn

xxz

.reject ,96.135.2 Since 0Hz

Page 25: Statr session 17 and 18 (ASTR)

Demonstration Problem 1

A sample of 87 professional working women showed that the average amount paid annually into a private pension fund per person was $3352. The population standard deviation is $1100. A sample of 76 professional working men showed that the average amount paid annually into a private pension fund per person was $5727, with a population standard deviation of $1700. A women’s activist group wants to “prove” that women do not pay as much per year as men into private pension funds. If they use α = .001 and these sample data, will they be able to reject a null hypothesis that women annually pay the same as or more than men into private pension funds? Use the eight-step hypothesis-testing process.

Page 26: Statr session 17 and 18 (ASTR)

Demonstration Problem 1 (Step 1)

Non Rejection Region

Critical Value

Rejection Region

.001

cZ 3 08. 0

H

H

o

a

:

:

1 2

1 2

0

0

Page 27: Statr session 17 and 18 (ASTR)

Demonstration Problem 1 (Steps 2 -7)

Non Rejection Region

Critical Value

Rejection Region

.001

cZ 3 08. 0

.H

.H

o

o

reject not do ,08.3 z If

reject 3.08,- <z If

42.10

761700

871100

05727335222

2

2

2

1

2

1

2121

nn

xxz

.Horeject 3.08,- < 10.42- = z Since

87

100,1$

352,3$

1

1

1

n

x

Women

76

700,1$

727,5$

2

2

2

n

x

Men

Page 28: Statr session 17 and 18 (ASTR)

Demonstration Problem 1(Step 8 – Business implications)

• The evidence is substantial that women, on average, pay less than men into private pension funds annually.

• The probability of obtaining an observed z value of -10.42 is virtually zero.

Page 29: Statr session 17 and 18 (ASTR)

Confidence Interval

• Sometimes the solution(s) is/are to take a random sample from each of the two populations and study the difference in the two samples.

• Formula for confidence interval to estimate (µ1 - µ2).

• Designating a group as group one, and another as group two is an arbitrary decision.

Page 30: Statr session 17 and 18 (ASTR)

Demonstration Problem 2

A consumer test group wants to determine the difference in gasoline mileage of cars using regular unleaded gas and cars using premium unleaded gas. Researchers for the group divided a fleet of 100 cars of the same make in half and tested each car on one tank of gas. Fifty of the cars were filled with regular unleaded gas and 50 were filled with premium unleaded gas. The sample average for the regular gasoline group was 21.45 miles per gallon (mpg), and the sample average for the premium gasoline group was 24.6 mpg. Assume that the population standard deviation of the regular unleaded gas population is 3.46 mpg, and that the population standard deviation of the premium unleaded gas population is 2.99 mpg. Construct a 95% confidence interval to estimate the difference in the mean gas mileage between the cars using regular gasoline and the cars using premium gasoline.

Page 31: Statr session 17 and 18 (ASTR)

Demonstration Problem 2

1

1

1

50

21.45

3.46

nx

Regular

2

2

2

50

24.6

2.99

nx

Premium

1.96 = Confidence %95 z

88.142.4

5099.2 2

5046.396.16.2445.21

505096.16.2445.21

21

2

21

22

2

2

2

1

2

12121

2

2

2

1

2

121

99.246.3

nnxxnnxx zz

Page 32: Statr session 17 and 18 (ASTR)

Hypothesis Test for Two Populations with population variances unknown

• Hypothesis test - compares the means of two samples to see if there is a difference in the two population means from which the sample comes.This is used when σ2 is unknown and samples are independent.

• Assumes that the measurement is normally distributed.

Page 33: Statr session 17 and 18 (ASTR)

Hypothesis Test for Two Populations with population variances unknown

If σ is unknown, it can be estimated by pooling the two sample variances and computing a pooled sample standard deviation

Page 34: Statr session 17 and 18 (ASTR)

t Statistic to test the

Difference in Means: 12 = 2

2

2121

2221

21

2121

112

)1()1(

)()(

nnnnnsns

xxt

Page 35: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing Company

At the Hernandez Manufacturing Company, an application of this test arises. New employees are expected to attend a three-day seminar to learn about the company. At the end of the seminar, they are tested to measure their knowledge about the company. The traditional training method has been lecture and a question-and-answer session. Management decided to experiment with a different training procedure, which processes new employees in two days by using DVDs and having no question-and-answer session.

Page 36: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing CompanyIf this procedure works, it could save the company thousands of dollars over a period of several years. However, there is some concern about the effectiveness of the two-day method, and company managers would like to know whether there is any difference in the effectiveness of the two training methods. The managers randomly select a group of 15 from the old method (Method A) and a group of 12 from the proposed method (Method B) and test all on a set of questions. The following are the scores of the groups.

Training Method A Training Method B56 50 52 44 52 59 54 55 6547 47 53 45 48 52 57 64 5342 51 42 43 44 53 56 53 57

Page 37: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing Company (Steps 1– 4)

H

H

o

a

:

:

1 2

1 2

0

0

060.2

25212152

025.2

05.

2

25,25.0

21

t

nndf

Rejection Region

Non Rejection Region

Critical Values

Rejection Region

2

025.

0 . , .025 25 2 060t

2

025.

. , .025 25 2 060t

If t < - 2.060 or t > 2.060, reject H .

If - 2.060 t 2.060, do not reject H .

o

o

Rejection Region

Rejection Region

Critical Values

0

Page 38: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing Company (Step 5)

Training Method A

56 51 45

47 52 43

42 53 52

50 42 48

47 44 44

Training Method B

59

52

53

54

57

56

55

64

53

65

53

57

495.19

73.47

15

21

1

1

s

x

n

273.18

5.56

12

22

2

2

s

x

n

Page 39: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing Company (Step 6-7)

1 2 1 2 1 2 1 2

2 2 2 21 2 1 1 2 2

1 2 1 2 1 2

( ) ( ) ( ) ( )

( 1) ( 1) 1 12

47.73 56.50 0

19.495 14 18.273 11 1 115 12 2 15 12

5.20

x x x xt

s s s n s n

n n n n n n

22 21 2

1 22 22 2

1 2

1 2

1 2

25

1 1

s sn n

dfs sn n

n n

.Ht

.Htt

o

o

reject not do 2.060, 2.060- If

reject 2.060, > or 2.060- < If

.Ht oreject -2.060,<-5.20= Since

Page 40: Statr session 17 and 18 (ASTR)

Hernandez Manufacturing CompanyBusiness Implications (Step 8)

• The conclusion is that there is a significant difference in the effectiveness of the training methods.

• Given that training method B scores are significantly higher and the fact that the seminar is a day shorter than method A (saving time and money), it makes business sense to adopt method B as the standard training method.

Page 41: Statr session 17 and 18 (ASTR)

Statistical Inferences for Two Related Populations

• Dependent samples Used in before and after studies After measurement is not independent of

the before measurement

Page 42: Statr session 17 and 18 (ASTR)

Hypothesis Testing

• Researcher must determine if the two samples are related to each other

• The technique for related samples is different from the technique used to analyze independent samples

• Matched pairs test requires the two samples to be of the same size

Page 43: Statr session 17 and 18 (ASTR)

Dependent Samples

• Before and after measurements on the same individual• Studies of twins• Studies of spouses

Individual

1

2

3

4

5

6

7

Before

32

11

21

17

30

38

14

After

39

15

35

13

41

39

22

Page 44: Statr session 17 and 18 (ASTR)

Hypothesis Testing

• The matched pair t test for dependent measures uses the sample difference, d, between individual matched samples as the basic measurement of analysis

• An analysis of d converts the problem from a two sample problem to a single sample of differences

• The null hypothesis states that the mean population difference is zero

• An assumption for the test is that the differences of two populations are normally distributed

Page 45: Statr session 17 and 18 (ASTR)

Hypothesis Testing:Formulas for Dependent Samples

difference samplemean =

difference sample ofdeviation standard =

difference populationmean =

pairsin difference sample =

pairs ofnumber

1

d

s

D

d

n

ndfn

sDd

t

t

d

1

)(

1

)(

22

2

nnd

d

n

dds

n

dd

d

Page 46: Statr session 17 and 18 (ASTR)

Hypothesis Testing: Degree of Freedom

• Analysis of data by this method involves calculating a t value with a critical value obtained from the table

• n in the degrees of freedom (n – 1) is the number of matched pairs or scores

Page 47: Statr session 17 and 18 (ASTR)

P/E Ratios for Nine RandomlySelected Companies

Suppose a stock market investor is interested in determining whether there is a significant difference in the P/E (price to earnings) ratio for companies from one year to the next. In an effort to study this question, the investor randomly samples nine companies from the Handbook of Common Stocks and records the P/E ratios for each of these companies at the end of year 1 and at the end of year 2.

Page 48: Statr session 17 and 18 (ASTR)

P/E Ratios for Nine RandomlySelected Companies

CompanyYear 1

P/E RatioYear 2

P/E Ratio

1 8.9 12.7

2 38.1 45.4

3 43.0 10.0

4 34.0 27.2

5 34.5 22.8

6 15.2 24.1

7 20.3 32.3

8 19.9 40.1

9 61.9 106.5

Page 49: Statr session 17 and 18 (ASTR)

Hypothesis Testing for Dependent Samples: P/E Ratios for Nine Companies

0:

0:

DH

DH

a

o

355.3

8191

01.

8,005.

t

ndf

.Hreject not do 3.355, 3.355- If

.Hreject 3.355, > or 3.355- < If

o

o

t

tt

Rejection Region

Non Rejection Region

Critical Value

0 355.3t

2

005.

355.3t

Rejection Region

2

005.

Page 50: Statr session 17 and 18 (ASTR)

Hypothesis Testing for Dependent Samples: P/E Ratios for Nine Companies

0:

0:

DH

DH

a

o

70.0

9

599.210033.5

599.21

033.5

t

s

d

d

oHreject not do ,355370.03553 . t = -.-Since

Page 51: Statr session 17 and 18 (ASTR)

Hypothesis Testing for Dependent Samples: P/E Ratios for Nine Companies – Software output

Page 52: Statr session 17 and 18 (ASTR)

Confidence Intervals for Mean Population Difference

• Researcher can be interested in estimating the mean difference in two populations for related samples

• This requires a confidence interval of D (the mean population difference of two related samples) to be constructed

Page 53: Statr session 17 and 18 (ASTR)

Confidence Interval for Mean Population Difference of Related Samples

1

ndfn

tdDn

td ss dd

Page 54: Statr session 17 and 18 (ASTR)

Difference in Number of New-House Sales

27.3

39.3

ds

d

Realtor May 2010 May 2011 d

1 8 11 -3

2 19 30 -11

3 5 6 -1

4 9 13 -4

5 3 5 -2

6 0 4 -4

7 13 15 -2

8 11 17 -6

9 9 12 -3

10 5 12 -7

11 8 6 2

12 2 5 -3

13 11 10 1

14 14 22 -8

15 7 8 -1

16 12 15 -3

17 6 12 -6

18 10 10 0

Page 55: Statr session 17 and 18 (ASTR)

Confidence Interval for Mean Differencein Number of New-House Sales

16.162.5

23.239.323.239.318

27.3898.239.3

18

27.3898.239.3

898.2

171181

17,005.

D

D

D

ntdD

ntd

t

ndf

ss dd

The analyst estimates with a 99% level of confidence that the average difference in new-house sales for a real estate company in Indianapolis between 2005 and 2006 is between -5.62 and -1.16 houses.

Page 56: Statr session 17 and 18 (ASTR)

Statistical Inference about Two Population Proportions ()

• Sample proportion used is ()

1 2 1 2

1 1 2 2

1 2

ˆ ˆ( ) ( )p p p pz

p q p qn n

1

2

1

2

1

2

1 1

2 2

proportion from sample 1

proportion from sample 2

size of sample 1

size of sample 2

proportion from population 1

proportion from population 2

1 -

1 -

ˆˆppnnppq pq p

Page 57: Statr session 17 and 18 (ASTR)

Statistical Inference about Two Population Proportions: Hypothesis Testing

• Because population proportions are unknown, an estimate of the Standard Deviation of the difference in two sample proportions is made by using sample proportions as point of estimates of the population proportion

Page 58: Statr session 17 and 18 (ASTR)

Z Formula to Test the Difference in Population Proportions

pq

P

qp

Z

nnpnpn

nnxx

nn

pppp

1

11

21

2211

21

21

21

2121

ˆˆ

ˆˆ