25
Lesson 10 - R Summary of Hypothesis Testing

Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Embed Size (px)

Citation preview

Page 1: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Lesson 10 - R

Summary of Hypothesis Testing

Page 2: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Objectives• Review Hypothesis Testing

Page 3: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Testing

• The process of hypothesis testing is very similar across the testing of different parameters

• The major steps in hypothesis testing are– Formulate the appropriate null and alternative

hypotheses– Calculate the test statistic– Determine the appropriate critical value(s)– Reach the reject / do not reject conclusions

Page 4: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Similarities in hypothesis test processes

Parameter Mean (σ known)

Mean (σ unknown)

Proportion Variance Std Dev

H0: μ = μ0 μ = μ0 p = p0 σ2 = σ02 σ = σ0

(2-tailed) H1: μ ≠ μ0 μ ≠ μ0 p ≠ p0 σ2 ≠ σ02 σ ≠ σ0

(L-tailed) H1: μ < μ0 μ < μ0 p < p0 σ < σ02 σ < σ0

(R-tailed) H1: μ > μ0 μ > μ0 p > p0 σ > σ02 σ > σ0

Test statistic Difference Difference Difference Ratio Ratio

Critical value Normal Student t Normal Chi-square Chi-square

Page 5: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 1

If a researcher wishes to test a claim that the average weight of a white rhinoceros is 5,000 lbs, then she should state a null hypothesis of

1) H1: Average weight = 5,000 pounds

2) H0: Average weight = 5,000 pounds

3) H0: Average weight ≠ 5,000 pounds

4) H0 + H1: Average weight = 5,000 pounds

Page 6: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 1

If the hypotheses for a test are

H0: μ = 20 seconds

H1: μ < 20 seconds

then an example of a Type I error occurs when

μ = 20 seconds and we did not reject H0

μ = 15 seconds and we rejected H0

μ = 25 seconds and we did not reject H0

μ = 20 seconds and we rejected H0

Page 7: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 2

The classical approach rejects the null hypothesis H0: μ = 20 when

1) The sample mean is far (too many standard deviations) from 20

2) The sample mean is not equal to 20

3) The sample mean is close (too few standard deviations) to 20

4) The sample mean is equal to 20

Page 8: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 2

In the P-value approach, relatively small values of the P-value correspond to situations where

1) The classical approach does not apply

2) The null hypothesis H0 must be accepted

3) The null hypothesis H0 must be rejected

4) The probability of obtaining such a sample mean is relatively small

Page 9: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 3

When the population standard deviation σ is not known, then we should perform hypothesis tests using

1) The alternative hypothesis

2) The t-distribution

3) The normal distribution

4) The Type II Error

Page 10: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 3

In testing a claim regarding a population mean with σ is unknown, we

1) May use only the classical approach with thet-distribution

2) May use only the P-value approach with thet-distribution

3) May use either the classical approach or the P-value approach with the t-distribution

4) May use either standard normal distribution with the t-distribution

Page 11: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 4

A possible null hypothesis for testing a claim regarding a population proportion is

1) H0: Mean Weight of Dogs = 20 kgs

2) H0: Standard Deviation of Weight of Dogs = 8 kgs

3) H0: Proportion of Dogs Weighs 30 kgs

4) H0: Proportion of Dogs that weigh < 30 kgs = 0.30

Page 12: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 4

Tests of a claim about a population proportion use

1) The normal model, or the binomial probability distribution if the sampling distribution is not normal

2) Always the normal model

3) Always the Type II model

4) The t-distribution, or the sampling distribution if the sample size is too small

Page 13: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 5

The test of a claim about a population standard deviation uses the

1) Normal distribution

2) The t-distribution

3) The chi-square distribution

4) All of the above

Page 14: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 5

If a sample size n is 65, then a test of a claim about a population standard deviation uses

1) A normal distribution with mean 65

2) A normal distribution with standard deviation 64

3) A chi-square distribution with 65 degrees of freedom

4) A chi-square distribution with 64 degrees of freedom

Page 15: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 6

To determine the appropriate hypothesis test to perform, we should

1) Consider which P-value we wish to obtain

2) Consider which type of parameter we are analyzing

3) Consider whether the null hypothesis is known or unknown

4) All of the above

Page 16: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 7

If the hypotheses for a test are

H0: μ = 20 seconds

H1: μ < 20 seconds

then an example of a Type II error occurs when

1) μ = 25 seconds and we did not reject H0

2) μ = 15 seconds and we rejected H0

3) μ = 15 seconds and we did not reject H0

4) μ = 20 seconds and we rejected H0

Page 17: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Chapter 10 – Section 7

A large power for a test occurs when

1) The Type II error β is small

2) The probability of failing to reject the null hypothesis, when the alternative hypothesis is true, is small

3) Distinguishing between the null hypothesis and the alternative hypothesis is relatively clear with the data

4) All of the above

Page 18: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Testing

H0: The status quo, what was done before, what we are trying to disprove

H1: The new item, the new study results

Test Statistics:

Critical Values: (left, two, right tailed tests)

Zc = Zα, 1-α/2, 1-α; tc = tα, 1-α/2, 1-α/n-1; χ²c = χ²1-α, 1-α/2, α/n-1

Conclusion:

If Zc < Z0, tc < t0, p < α, or χ²c < χ²0 then Reject H0

Otherwise we Fail to Reject (FTR)

x - μZ0 = ---------- σ / √n

x - μt0 = ---------- s / √n

n s²χ²0 = -------- σ²

p - pZ0 = ---------- p(1-p) -------- n

^

Test μ σ known

Test μ σ unknown

Test population prop

Test σ

Page 19: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Testing Methods

• Classical– More standard deviations away from mean

• P-Value– Probability of getting a more extreme value

• Confidence Interval– Within the interval

Q0

Q0

LB UB

FTR

FTR

FTR

Rej H0 Rej H0

Rej H0

Rej H0

Page 20: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Requirements to Check

• Mean, σ Known– Simple Random Sample (SRS)– Normal distribution

• Mean, σ unknown– SRS– No outliers and “normality” (normality plot)

• Population Proportion– SRS– n(p)(1-p) ≥ 10 (allows normal estimation of binomial)– n ≤ 0.05N (keeps it from being hypergeometric)

• Variance or Standard Deviation– SRS– Normal distribution

Page 21: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Test – Mean, σ Known

USAA Auto Insurance data base show the average miles driven is 12,200. A local rep, Sam, believes the residents of southwestern Virginia drive more. He obtains a sample of 35 drivers whose average was 12,895.9. Using USAA’s database σ = 3800 miles. Test his claim at the α = 0.01 level.

X-bar – μZ0 = --------------- = 1.083 and p = 0.13931 (from calculator) σ / √n

x-bar = 12,895.9μ0 = 12,200σ = 3800n = 35α = 0.01

H0: μ0 = 12,200 (drivers in southwestern VA drive the same as elsewhere)

H1: μ0 > 12,200 (drivers in southwestern VA drive more than elsewhere)

Critical Values: Zc = 2.326 Confidence Interval (CI) [11241, 14550]

Conclusion: Since Z0 < Zc (μ0 in CI or p > α), we fail to reject H0 and conclude that we don’t have sufficient evidence to say SWVA drivers drive more.

Page 22: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Test – Mean, σ Unknown A high school principal believes that the new attendance policy has reduced the average number of tardies among the habitual tardy students. He samples 40 of his habitual tardy students and determines that their average tardies was 16.8 with a standard deviation of 4.7. He wants you to test at the α = 0.1 level to see if the average number of tardies was less than the historic mean of 18.1.

X-bar – μt0 = --------------- = -1.7493 and p = 0.04405 (from calculator) s / √n

x-bar = 16.8μ0 = 18.1σ = 4.7n = 40α = 0.1

H0: μ0 = 18.1 (habitual tardiness remained the same)

H1: μ0 < 18.1 (habitual tardiness decreased)

Critical Values: tc = -1.304 Confidence Interval (CI) [15.548, 18.052]

Conclusion: Since t0 < tc (μ0 out of CI or p < α), we reject H0 and conclude that the habitual tardiness has decreased.

Page 23: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Test – Population Proportion

In the 1990’s 65% of students at Virginia Tech thought that lying was unethical. In a poll conduct last May in a simple random sample of 1005 Virginia Tech students, 704 responded that lying was unethical. Is there evidence to indicate that the percentage of students who believe that lying is unethical has increased at the α = 0.05 level.

p-hat – p0

Z0 = --------------- = 3.356 and p = 0.0004 (from calculator) √p0(1-p0)/n

p0 = 0.65x = 704n = 1005α = 0.05

H0: p0 = 0.65 (% who thought lying was unethical behavior is the same)

H1: p0 > 0.65 (% who thought lying was unethical behavior has increased)

Critical Values: Zc = -1.304 Confidence Interval (CI) [0.672, 0.728]

Conclusion: Since Z0 > Zc (p0 out of CI or p < α), we reject H0 and conclude that the percentage who believe lying is unethical has increased.

Page 24: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Hypothesis Test – Population Variance A snack bag of plain M&M’s has a mean number of M&M’s of 21. The quality control people at M&M-Mars have published data on the internet the claims the standard deviation of the number of M&Ms to be under 0.75. A Stats class samples 11 snack bags of plain M*Ms and determines that the standard deviation was 0.6404. Their teacher wants to know if their sample standard deviation is smaller than the advertised at the α = 0.05 level

n s²χ²0 = --------------- = 7.291 (by hand) p-value = 0.302 (by χ²cdf) σ²0

σ0 = 0.75s = 0.6404n = 11α = 0.05

H0: σ0 = 0.75 (the standard deviation of M&Ms in snack bags is the same)

H1: σ0 < 0.75 (the standard deviation of M&Ms in snack bags has decreased)

Critical Values: χ²c = 3.940 Confidence Interval: NA

Conclusion: Since χ0 > χc (or p > α), we fail to reject H0 and conclude that there is insufficient evidence that σ in plain M&M snack bags has decreased.

Page 25: Lesson 10 - R Summary of Hypothesis Testing. Objectives Review Hypothesis Testing

Summary and Homework• Summary

– We can test whether sample data supports a hypothesis claim about a population mean, proportion, or standard deviation

– We can use any one of three methods• The classical method• The P-Value method• The Confidence Interval method

– The commonality between the three methods is that they calculate a criterion for rejecting or not rejecting the test statistic

• Homework– pg 511-513; 1, 2, 3, 7, 8, 12, 13, 14, 15, 17, 20, 37