In this chapter we look at hypothesis testing and confidence intervals used for comparing two...

26
In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions. Chapter 20 Comparing Groups

Transcript of In this chapter we look at hypothesis testing and confidence intervals used for comparing two...

Page 1: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Chapter 20Comparing Groups

Page 2: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Combining Random Variables

Suppose A and B are random variables with means μA and μB and standard deviations σA and σB.

The variable (A – B) has mean and standard deviation:

Page 3: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

Hypotheses

Page 4: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

Test Statistic

Page 5: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

P - value

Depends on the alternative hypothesis:

(a) (upper tail test)

(b) (lower tail test)

(c) (two-tailed test)

Page 6: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

Validity/Assumptions

We have properly collected, independent, random samples from each population.

We have a large enough samples (at least 10 “Y” and at least 10 “N” are in both samples)

The sample sizes are not more than 10% of the total populations from which they are drawn.

Page 7: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

Technology

We will not do this by hand with the formulas. Rather we can use the 2-PropZTest command in the calculator.

Whichever group is written first in our hypotheses must be considered “group 1” in the calculator.

Page 8: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 1

In October 2000, the results of a large survey showed that 84.9% of 12460 males and 88.1% of 12678 females had graduated from high school. Does this study support that claim that females were more likely to graduate from high school than males in 2000? Test the relevant hypotheses at the = 0.05 level.

Page 9: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 2

On April 12, 1955, Dr. Jonas Salk released the results of clinical trials for his polio vaccine. In these trials, 400000 children were randomly divided into 2 groups of 200000 each. One group was given the vaccine, the other a placebo. Of those given the vaccine, 33 developed polio. Of those given the placebo, 115 developed polio. Test at the = 0.01 level whether receiving the vaccine lowers the chance of getting polio.

Page 10: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for p1-p2

Assumptions/Requirements

We have properly collected, independent, random samples from each population.

We have a large enough samples (at least 10 “Y” and at least 10 “N” are in both samples)

The sample sizes are not more than 10% of the total populations from which they are drawn.

Page 11: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for p1-p2

Formula

p1 – p2 is in the interval:

• z* = 1.645 for 90% confidence

• z* = 1.96 for 95% confidence

• z* = 2.33 for 98% confidence

Page 12: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for p1-p2

We will not construct these by hand, however we can construct them using the TI – 83/84 by pressing , choosing “TESTS”, then choosing 2-PropZInt…

Enter the number of successes and sample sizes for each group, the confidence level, then Calculate.

Page 13: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for p1-p2

Confidence Interval Approach

We can replace the test statistic and P-value with a confidence interval for p1 – p2 calculated from the samples.

If 0 is not in the interval, then we reject H0

If 0 is in the interval, then we fail to reject H0

All other “pieces” of the hypothesis test are the same.

Page 14: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 3

A study was conducted to see if putting duct tape over a wart worked better than traditional treatments. Of 104 subjects that used duct tape, 84.6% were “healed”. Of 100 subjects using traditional treatments, 60% were “healed”. Do these samples significantly support that duct tape works better? Test the relevant hypotheses using a 96% confidence interval.

Page 15: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

Hypotheses

Page 16: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

Test Statistic

where:

Page 17: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

P – value

Depends on the alternative hypothesis:

(a) (upper tail test)

(b) (lower tail test)

(c) (two-tailed test)

where df = nasty formula on last slide

Page 18: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

Validity/Assumptions

We have independent, properly collected, random samples (one from each population)

Sample sizes are not more than 10% of the populations

One of the following for each:

• population known to be normal

• large sample size (C.L.T.): n ≥ 30 or

• approximately linear normal plot of sample data

Page 19: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

We will NOT do this by hand.

We can use the 2-SampTTest in the TI calculator to do this.

Go into the STAT menu, choose TESTS, then choose 2-SampTTest…

If you have the actual sample data in L1 and L2, choose “Data”, if you have the summary statistics for the sample, choose “Stats”.

Page 20: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 4

Are the prices charged for a used camera higher on average when buying from a stranger than when buying from a friend? Test the sample data below.

Stranger 275 300 260 300 255 275 290 300

Friend 260 250 175 130 200 225 240

Page 21: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 5

Ann thinks that there is a difference in quality of life between rural and urban living. She collects information from obituaries in newspapers from urban and rural towns in Idaho to see if there is a difference in life expectancy. A sample of 4 people from rural towns give a life expectancy of years with a standard deviation of sr = 6.44 years. A sample of 10 people from larger, urban towns give years and su = 6.14 years. Does this provide evidence that people living in rural Idaho communities have different life expectancy than those in more urban communities? Use a 1% level of significance.

Page 22: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for μ1 - μ2

Assumptions/Requirements

We have properly collected, independent, random samples from each population.

One of the following for each:

• population known to be normal

• large sample size (C.L.T.): n ≥ 30 or

• approximately linear normal plot of sample data

The sample sizes are not more than 10% of the total populations from which they are drawn.

Page 23: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for μ1 - μ2

Formula

μ1 – μ2 is in the interval:

where df is the same as for hypothesis testing

Page 24: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Confidence Interval for μ1 - μ2

We will not construct these by hand, however we can construct them using the TI – 83/84 by pressing , choosing “TESTS”, then choosing 2-SampTInt…

If you have the actual sample data in L1 and L2, choose “Data”, if you have the summary statistics for the sample, choose “Stats”.

Page 25: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Hypothesis Tests for μ1-μ2

Confidence Interval Approach

We can replace the test statistic and P-value with a confidence interval for μ1 – μ2 calculated from the samples.

If 0 is not in the interval, then we reject H0

If 0 is in the interval, then we fail to reject H0

All other “pieces” of the hypothesis test are the same.

Page 26: In this chapter we look at hypothesis testing and confidence intervals used for comparing two populations – both means and proportions.

Example 6

Are the average lifespans of name brand batteries and generic batteries the same when used in portable CD players. The data below is in hours. Test the relevant hypotheses using a 95% confidence interval.

Name Brand 190.7 203.5 203.5 206.5 222.5 209.5

Generic 194 205.5 199.2 172.4 184.0 169.5