Confidence Intervals and Hypothesis testing | STAT 30100, Study notes of Data Analysis & Statistical Methods

Material Type: Notes; Professor: Sorola; Class: Elementary Statistical Methods; Subject: STAT-Statistics; University: Purdue University - Main Campus; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-hiw
koofers-user-hiw 🇺🇸

5

(1)

10 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Chapter 6
Confidence Intervals and Hypothesis Testing
Why do we even bother analyzing data?
We want to draw conclusions from the data.
Why can’t we just accept our sample mean or sample proportion as the
official mean or proportion for the population? Every time we estimate
the statistics
ˆ
,
x p
(sample mean and sample proportion), we get a
different answer due to sampling variability.
Two most common types of formal statistical inference:
Confidence Intervals: when we want to estimate a population
parameter
Significance Tests: when we want to assess the evidence provided
by the data in favor of some claim about the population (yes/no
question about the population)
Confidence Intervals allow us to estimate a range of values for the
population mean or population proportion.
The true mean or proportion for the population exists and is a fixed
number, but we just don’t know what it is. Using our sample statistic,
we can create a “net” to give us an estimate of where to expect the
population parameter to be.
Confidence interval = net
Population parameter = invisible, stationary butterfly
We don’t know exactly where the butterfly is, but from our sample, we
have a pretty good estimate of the location.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Confidence Intervals and Hypothesis testing | STAT 30100 and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

Chapter 6 Confidence Intervals and Hypothesis Testing

Why do we even bother analyzing data? We want to draw conclusions from the data.

Why can’t we just accept our sample mean or sample proportion as the official mean or proportion for the population? Every time we estimate

the statistics x^ , p ˆ^ (sample mean and sample proportion), we get a

different answer due to sampling variability.

Two most common types of formal statistical inference:

  • Confidence Intervals : when we want to estimate a population parameter
  • Significance Tests : when we want to assess the evidence provided by the data in favor of some claim about the population (yes/no question about the population)

Confidence Intervals allow us to estimate a range of values for the population mean or population proportion.

The true mean or proportion for the population exists and is a fixed number, but we just don’t know what it is. Using our sample statistic, we can create a “net” to give us an estimate of where to expect the population parameter to be.

Confidence interval = net

Population parameter = invisible, stationary butterfly

We don’t know exactly where the butterfly is, but from our sample, we have a pretty good estimate of the location.

If you increase the sample size ( n ) , you decrease the size of your “net” (or your margin of error).

If you increase your confidence level ( C ) , then you increase the size of your “net” (or your margin of error).

If we take a single sample, our single confidence interval “net” may or may not include the population parameter.

However if we take many samples of the same size and create a confidence interval from each sample statistic, over the long run 95% of our confidence intervals will contain the true population parameter (if we are using a 95% confidence level).

What if your margin of error is too large? Here are ways to reduce it:

  • Increase the sample size (bigger n )
  • Use a lower level of confidence (smaller C )
  • Reduce σ x

Sample Size, n, for Desired Margin of Error, m:

  • 2 n z x m

 σ  =   

Note that it is the sample size, n , that influences the margin of error. The population size has nothing to do with it.

Be careful!!!! You can only use the formula x z * x n

± σ under certain

circumstances:

  • Data must be an SRS from the population.
  • Do not use if the sampling is anything more complicated than an SRS.
  • Data must be collected correctly (no bias). The margin of error covers only random sampling errors. Undercoverage and nonresponse are not covered.
  • Outliers can have a big effect on the confidence interval. (This makes sense because we use the mean and standard deviation to get a CI.)
  • You must know the standard deviation of the population, σ (^) x.

Examples:

  1. A questionnaire of drinking habits was given to a random sample of fraternity members, and each student was asked to report the # of beers he had drunk in the past month. The sample of 30 students resulted in an average of 22 beers with standard deviation of 9 beers.

a) Give a 90% confidence interval for the mean number of beers drunk by fraternity members in the past month.

b) Is it true that 90% of the fraternity members each month drink the number of beers that lie in the interval you found in part (a)? Explain your answer.

c) What is the margin of error for the 90% confidence interval?

d) How many students should you sample if you want a margin of error of 1 for a 90% confidence interval?

Hypothesis Testing

The 4 steps common to all tests of significance:

  1. State the null hypothesis H 0 and the alternative hypothesis Ha.
  2. Calculate the value of the test statistic.
  3. Draw a picture of what Ha looks like, and find the P -value.
  4. State your conclusion about the data in a sentence, using the P -value and/or comparing the P -value to a significance level for your evidence.

STEP 1: State the null hypothesis H 0 and the alternative hypothesis Ha.

To do a significance test, you need 2 hypotheses:

  • H 0 , Null Hypothesis : the statement being tested, usually phrased as “no effect” or “no difference”.
  • Ha , Alternative Hypothesis : the statement we hope or suspect is true instead of H 0.

Hypotheses always refer to some population or model. Not to a particular outcome.

Hypotheses can be one-sided or two-sided.

  • One-sided hypothesis : covers just part of the range for your parameter

H 0 : μ = 10 OR H 0 : μ = 10

Ha : μ > 10 Ha : μ < 10

  • Two-sided hypothesis : covers the whole possible range for your parameter

H 0 : μ = 10

Ha : μ ≠ 10

Even though Ha is what we hope or believe to be true, our test gives evidence for or against H 0 only.

We never prove H 0 true, we can only state whether we have enough evidence to reject H 0 (which is evidence in favor of Ha , but not proof that Ha is true) or that we don’t have enough evidence to reject H 0****.

Example (Exercise 6.37, p. 418): Each of the following situations

requires a significance test about a population mean μ. State the

appropriate null hypothesis H 0 and alternative hypothesis Ha in each case:

a. Census Bureau data shows that the mean household income in the area served by a shopping mall is $72,500 per year. A market research firm questions shoppers at the mall to find out whether the mean household income of mall shoppers is higher than that of the general population.

b. Last year, your company’s service technicians took an average of 1.8 hours to respond to trouble calls from business customers who had purchased service contracts. Do this year’s data show a different average response time?

Z -Test for a Population Mean

To test the hypothesis H 0 : μ = μ 0 based on an SRS of size n from a

population with unknown mean μ and known standard deviation σ,

  • compute the test statistic: 0 0 /

Z x n

μ σ

=^ −

  • the P -values for a test of H 0 against:

These P -values are exact if the population is normally distributed, and are approximately correct for large n in other cases.

Ha: μ > μ 0 is P( ZZ 0 )

Ha: μ < μ 0 is P( ZZ 0 )

Ha: μ ≠ μ 0 is 2* P( Z| Z 0 | )

Examples:

  1. Last year the government made a claim that the average income of the American people was $33,950. However, a sample of 50 people taken recently showed an average income of $34,076 with a population standard deviation of $324. Is the government’s estimate too low? Conduct a significance test to see if the true mean is more than the reported average. Use an α=0.01.
  2. An environmentalist collects a liter of water from 45 different locations along the banks of a stream. He measures the amount of dissolved oxygen in each specimen. The mean oxygen level is 4. mg, with the overall standard deviation of 0.92. A water purifying company claims that the mean level of oxygen in the water is 5 mg. Conduct a hypothesis test with α=0.001 to determine whether the mean oxygen level is less than 5 mg.

Annual Drinking Water Quality Report, 2004, Town of Brookston, IN

“I’m pleased to report that our drinking water is safe and meets federal and state requirements.”

Test Results (MCL is the maximum contaminant level, the highest level of a contaminant that is allowed in drinking water.)

Contaminant Violation Y/N

Level Detected

Unit measurement

MCL

Beta/photon emitters

N (^) 2.1 ± 3.2 mrem/yr 4

Alpha emitters

N 0 ± 1.6 pCi/l 15

Barium N 0.216 ppm 2 Copper N 0.039 to

ppm 1.

Fluoride N 0.01 ppm 4 Sodium N 0.0 ppm N/A

One of these violation reports should actually be a “yes” instead of a “no.” Which one is it and why? What hypotheses go along with these confidence intervals?

Note: When I called the town of Brookston office to ask them about this, the water manager called the state EPA office to get more information. What they told him was that, yes, technically I was correct, but that they don’t use the confidence intervals that are reported. Apparently these are the FEDERAL EPA rules. They only use the mean. I tried to get sample size or other information, but I wasn’t able to learn anything more.

P -values can be more informative than a reject/do not reject H 0 based on

α. As P -value gets smaller the evidence for rejecting H 0 gets

stronger.

Just because we use α = 0.05 a lot doesn’t mean that’s the level you

have to use—it’s just the most common. There’s nothing particularly special about that level.

In a large sample, even tiny deviations from the null hypothesis can be important.

If we fail to reject H 0 , it may be because H 0 is true or because our sample size is insufficient to detect the alternative.

Plot your data and look at your P -value to determine your conclusions. Could outliers be part of the problem?

A confidence interval actually estimates the size of an effect rather than simply asking if it is too large to reasonably occur by chance alone.

You must have a well-designed experiment in order for statistical inference to work. Randomization is important.