Today’s Agenda

  • Type Errors

  • In a hypothesis test, we assume the null hypothesis is true.
  • Because of this, we can draw a picture of our sampling distribution and know the center (null hypothesis)
  • Collect data and make a measurement
    • If your measurement is considered to be rare: we reject the null hypothesis
    • rare means that the p-value for your measurement is smaller than your significance level.
    • If your measurement is not very rare: we fail to reject the null hypothesis

Decision Errors

\(H_0\) is True \(H_0\) is False
Do not reject \(H_0\) Correct conclusion Type II error
Reject \(H_0\) Type I error Correct conclusion
  • Consider the example of average GPA of Davidson students

Assume the true average: 3.7

\(H_0:\) the average GPA is 3.2 \(H_A:\) the average GPA is not 3.2

Suppose we take a sample and it is so rare that we reject the null. This is a desired result

But we could take a sample and get a GPA of 3.21, we would fail to reject the null. This would be a Type II error

  • The probability of a type I error is \(\alpha\) the significance level
  • The probability of a type II error is \(\beta\)

A snack-food company produces a 454-g bag of pretzels. Although the actual net weights deviate slightly from \(454\) g and vary from one bag to another, the company insists that the mean net weight of the bags be \(454\) g. As part of its program, the quality assurance department periodically performs a hypothesis test to decide whether the packaging machine is working properly, that is, to decide whether the mean net weight of all bags packaged is \(454\) g. The quality assurance person wants to test if the average weight is more.

\(H_0: \mu = 454\)

\(H_A: \mu > 454\)

Type I error: The pretzel bags really do have an average mass of 454 grams and we reject the null hypothesis. That will happen when our sample is much bigger than 454

Type II error: The pretzel bags really do have more mas than 454 grams but we fail to reject the null.

Power

Example: The manufacturer of a new model car claims that a typical car gets 26 miles per gallon (mpg). A consumer advocacy group is skeptical of this claim and thinks that the mean gas mileage, \(\mu\), of may be less than 26 mpg. The standard deviation of gas mileage for these cars is known to be 2.5 mpg. The group plans to perform the hypothesis test

\(H_0: \mu = 26\) mpg

\(H_A: \mu < 26\) mpg

at a \(5 \%\) significance level using a sample of size 30. Find the probability of making a type II error if the true mean gas mileage is:

\(25\) mpg

  • we need to calculate the area to the right of the significance level on the correct curve.
qnorm(.05)*2.5/sqrt(30) + 26
## [1] 25.24923
1-pnorm(25.2,25,2.5/sqrt(30))
## [1] 0.3306286
# There is a 33% chance of obtaining a sample with average mpg of greater than 25.2 if the true average is 25 mpg. There is a 33% chance of making a type II error.

\(24.8\) mpg

# 1. draw sampling distribution of null hypothesis
# 2. Find the cut-off value
qnorm(.05,26,2.5/sqrt(30))
## [1] 25.24923
# 3. Draw the correct sampling distribution
# 4. Calculate the area past the significance leve on the correct curve

The power is 1-\(\beta\), experimenters usually want power to be at least 80%.

  1. Cadmium, a heavy metal, is toxic to animals. Mushrooms, however, are able to absorb and accumulate cadmium at high concentrations. The Czech and Slovak governments have set a safety limit for cadmium in dry vegetables at \(0.5\) part per million (ppm). A hypothesis test is to be performed to decide whether the mean cadmium level in mushrooms is greater than the government’s recommended limit. It is known that the population is normally distributed and has standard deviation \(0.37\) ppm of cadmium. A sample of \(12\) mushrooms has a mean cadmium level of \(0.55\) ppm a significance level of \(5 \%\). Does the data provide statistically significant evidence that the mean cadmium levels is higher than the goverment’s recommend limit?

  2. If the true average is \(0.8\) ppm, what is the power of the test at detecting this?