Lecture #23 Tuesday, November 8, 2016 Textbook: 13.1 through 13.4 Statistics 200 Lecture #23 Tuesday, November 8, 2016 Textbook: 13.1 through 13.4 Objectives: • Formulate null and alternative hypotheses involving population means • Calculate T-statistics (for means) instead of Z-statistics (for proportions); determine correct degrees of freedom. • Determine correct test procedure from context of problem. • Identify potential errors that can occur in hypothesis testing; distinguish between type I and type II errors.
Statistical Hypotheses Null Hypothesis, H0: Nothing happening No change / difference Alternative Hypothesis, Ha: Something is happening There is a change / difference
Five steps for a statistical hypothesis test H0 and Ha Z = ___ or T= ___ p = ____ Reject H0 or fail to reject H0 We conclude that… Formulate null and alternative hypotheses. (Verify necessary data conditions and) summarize data into a test statistic. Find a p-value. Make a decision. Report the conclusion in context.
General test statistic formula: An example from Lecture 18: A test for one proportion A sample of 300 drivers from the 16–24 age group found 105 who say that they have driven while drowsy in the last year. Have more than 30% of this age group driven while drowsy in the past year? Check: Both n*p-hat and n*(1–p-hat) are 10.
An example from Lecture 18: A test for one proportion H0: p = 0.30 Ha: p > 0.30 Under H0 assumption Test statistic:
An example from Lecture 18: A test for one proportion With a p-value smaller than 0.05, we reject the null hypothesis. This means we have statistically significant evidence that more than 30% of this age group has driven while drowsy in the past year. P-value = P(Z>1.89) = 0.0294
Today: We consider T statistics (for means) instead of Z statistics (for proportions) The formula is still: Check: n>30 or normal sample In the case of one mean, we have:
Today: We consider T statistics (for means) instead of Z statistics (for proportions) The formula is still: Check: n>30 or normal sample In the case of the mean of paired differences, we have:
Today: We consider T statistics (for means) instead of Z statistics (for proportions) The formula is still: Check: n>30 or normal sample fpr each sample In the case of difference of two means, we have:
Motivating example: is my spin class hurting my hearing? Loud music and spin classes go hand-in-hand, but is the music loud enough to permanently damage hearing? The threshold for hearing loss is accepted to be 85 db. Research Question: Does the average music volume at a spin class exceed 85 db?
Yes – data looks normalish Measured variable: the noise level (in decibels) of music played during exercise classes at a local gym Do the data suggest that the population mean noise level is greater than 85 decibels? Sample from Survey: n = 20 classes mean = 89.8 decibels s = 7.64 decibels Can we use the one-sample t procedure? Yes – data looks normalish State the hypotheses: H0: µ = 85 Ha: µ > 85
H0: μ = 85 decibels Ha: μ > 85 decibels Calculate and interpret the t test statistic H0: μ = 85 decibels Ha: μ > 85 decibels Sample from Survey: n = 20 classes; mean = 89.8 decibels; st dev = 7.64 decibels d.f. = n – 1 = 19 Interpret t statistic: Our sample mean of 89.8 is 2.81 standard deviations above he population mean of 85, assuming the null is true.
Find the p-value in Minitab Select: t table and df = 19 Graph -> Probability Distribution Plots select
Find the p-value in Minitab (continued) H0: μ = 85 decibels Ha: μ > 85 decibels T = 2.81 creates p-value picture found on next slide
p-value picture - one-sided test H0: μ = 85 decibels Ha: μ > 85 decibels df = 19 Interpretation: The likelihood of getting a t-statistic at least as _____ as 2.81, assuming the null hypothesis is true, equals 0.006. large
What can go wrong: Two types of errors This comes from Section 12.1. Consider a medical test for a disease in which the hypotheses are H0: You do not have the disease. Ha: You do have the disease. If you decide to reject H0 but you turn out to be incorrect, this is a false positive. If you decide not to reject H0 but you turn out to be incorrect, this is a false negative.
What can go wrong: Two types of errors This comes from Section 12.1. Consider a medical test for a disease in which the hypotheses are H0: You do not have the disease. Ha: You do have the disease. A false positive is called a type I error. A false negative is called a type II error.
What can go wrong: Two types of errors This comes from Section 12.1. Generally speaking: • A type I error occurs when you erroneously reject H0. • A type II error occurs when you erroneously fail to reject H0. The power of a test is the probability, given a particular alternative is true, of rejecting H0. The level of significance is the p-value cutoff for rejecting H0. (Often it’s 0.05.) If H0 is true, the level of significance is the probability of a type I error.
Decision and conclusion: Clicker Question H0: μ = 85 Ha: μ > 85 p-value = 0.006 Can reject H0 in favor of Ha. Can claim μ > 85. Type 2 error is now possible. Can reject H0 in favor of Ha. Can claim μ > 85. Type 1 error is now possible. Can’t reject H0 in favor of Ha. Cannot claim μ > 85. Type 2 is error is now possible. Can’t reject H0 in favor of Ha. Cannot claim μ > 85. Type 1 error is now possible.
Hypothesis Tests: One Sample Response Variable Categorical Quantitative Population Parameter Sample Estimate Inferential Procedure one-proportion Z one-sample t Test statistic Chapter 12 13 P-value Z table T table with df = (n – 1) because σ is unknown
Which procedure should we use? What kind of data do we have? What kind of research question do we have? Show something specific Estimate a population parameter Categorical (binomial) Quantitative Pop. mean: µ Hypothesis Test Confidence interval Pop. proportion: p
Example: Researchers at Penn State are interested in estimating the percentage of underage students who drink alcohol at least once a month. They should… Construct a confidence interval for a population proportion Perform a hypothesis test for a population proportion Construct a confidence interval for a population mean Perform a hypothesis test for a population mean
What is the average number of texts that a STAT 200 student receives on a weekday? To answer this question we should… Construct a confidence interval for a population proportion Perform a hypothesis test for a population proportion Construct a confidence interval for a population mean Perform a hypothesis test for a population mean
Do more than 30% of Penn State students binge drink at least once a month on average? To answer this question we should… Construct a confidence interval for a population proportion Perform a hypothesis test for a population proportion Construct a confidence interval for a population mean Perform a hypothesis test for a population mean
If you understand today’s lecture… 13.1, 13.3, 13.17, 13.19, 13.23, 13.25, 13.63, 13.67, 13.99 Objectives: • Formulate null and alternative hypotheses involving population means • Calculate T-statistics (for means) instead of Z-statistics (for proportions); determine correct degrees of freedom. • Determine correct test procedure from context of problem. • Identify potential errors that can occur in hypothesis testing; distinguish between type I and type II errors.