1 / 67

Hypothesis Testing – Part I

Hypothesis Testing – Part I. Recall: We learned how to describe data Made no assumptions about where the data came from Nor about method of sampling We focused on methods of sampling Probability samples Learned how to calculate probabilities

Download Presentation

Hypothesis Testing – Part I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hypothesis Testing – Part I

  2. Recall: • We learned how to describe data • Made no assumptions about where the data came from • Nor about method of sampling • We focused on methods of sampling • Probability samples • Learned how to calculate probabilities • Focus on specific probability distributions

  3. We learned how to estimate unknown population parameters • Goal: to try to understand the characteristics (parameters) of the population that gave rise to our sample data • 4. Now, we’ll learn how to evaluate alternative explanations for the data we have observed • The purpose is to test a research hypothesis

  4. Examples of Research Hypotheses 1.Early treatment, compared to later treatment, of patients with an evolving Ml will result in better heart function (ejection fraction) at 24 hours. 2. The implementation of policy “A” will result in a reduction in the inappropriate use of a particular drug. 3. The delivery of an educational intervention to high school students will result in greater use of “safer” sex practices. 4. The average cost of a particular procedure is $X.

  5. To answer such questions, • we collect data • then analyze the data • to see if they are compatible with the research hypothesis being true. • We reason by use of “proof by contradiction” • Proof by example won’t work. • The critic can always claim a counter example must exist.

  6. The Logic of Statistical Hypothesis Testing • The investigator starts • by presuming the NULL explanation, eg: • The treatment as NO benefit • The new cost is the same as the old (there is NO difference between cost of new and old) • Data are then collected and evaluated for consistency with the NULL explanation

  7. If the data are NOT consistent with the null explanation • then abandon the null explanation in favor of an alternative • Typically, it is the alternative explanation that the investigator would like to advance

  8. If the null hypothesis is not true – • Then some alternative hypothesis must be true • This suggests some guidelines: • We’ll let “Ho” represent the null hypothesis“Ha” represent the alternative hypothesis • (called “H-naught” or “H-a”

  9. The null and alternative hypotheses are typically specified so that • The null is the one we hope to contradict • The null and alternative are • Mutually exclusive • Collectively exhaustive • Both should be specified in advance! – before the data is collected.

  10. The Research Hypothesis  Ho and Ha • Examples • Early treatment post MI results in better function of the heart at 24 hours (better = higher) • Define study with: • Group 1 = “Early” m1 = true mean at 24 hours • Group 2 = “Late” m2 = true mean at 24 hours • Research hypothesis says m1 > m2 •  This is the alternative hypothesis since it is the explanation the investigator seeks to advance.

  11. Thus, with the alternative defined, the null is defined to be anything other than the alternative: • That is, m1 m2 • Thus we have: Note that we can rewrite the hypotheses to compare the difference between group means to zero

  12. If our research hypothesis is that “early treatment leads to different heart function at 24 hours” • then our alternative is that the means are not equal: m1¹ m2

  13. The first case is called a one-sided alternative • we are interested in a change in only one direction : m1 > m2 • The second case is called a two-sided alternative • we consider change in either direction away from equality: m1m2

  14. Example 2: • The average cost of a particular procedure is $X • Suppose a medical insurance company wants to pay no more than $500 for a particular surgical procedure: • Let m = true average cost • The research hypothesis says m 500 •  specify this as the alternative hypothesis • Thus, Ho: m≥ 500 • Ha: m< 500

  15. Hypothesis test as “proof by contradiction” • Assume null hypothesis is true • Determine a “rejection region” corresponding to values unlikely to occurusing this assumption (Ho true) • Either:“Reject” Ho if the observed data is in the rejection region.OR“Fail to Reject” Ho if data in the rejection region with assumption

  16. For example we will reject Ho: m > 500 • when X is low enough that we believe the true mean must be less than $500 Rejection Region X 500

  17. Steps in Constructing a Statistical Hypothesis Test • 1. Identify the research question • 2. State the assumptions necessary for computing probabilities • 3. Specify Ho and Ha and the α-level (usually α = 0.05) • Specify the test statistic • Specify a decision rule • 6. Compute the test statistic and the achieved significance( or P - value) from sample data • 7. Come to a “Statistical” Decision • 8. Reach a Conclusion • 9. Report a confidence interval

  18. Example: • 1. Identify the research question • Suppose the mean birth weight for 1998 of all US hospital births is known to be m = 3400 gm with s = 710 gm, based upon national birth certificate data. • How do births at Hospital A compare? • We are asking • Is the mean birth weight at Hospital A different from the national mean?

  19. Experiment: Collect birth weights of 100 consecutive births at Hospital A and compute our sample mean of x = 3250 gm. • What Assumptions must we make about our data to compute probabilities?Assume: • a random sample of births from • a population with known s = 710 gm (known national standard deviation). • Thus, by the central limit theorem:

  20. Specify null and alternative hypotheses: • Ho: The true mean birth weight at Hospital A is the same as the national mean. • Ha: The true mean birth weight at Hospital A is different from the national mean • Or • Ho: m = 3400 • Ha: m 3400

  21. 4. Compute the Test Statistic • This is where the proof by contradiction thinking comes in. • We want to know: • If it is true that m = 3400 gm (Ho) • what are the chances of observing a sample mean as far away from m = 3400 as x = 3250?

  22. Since Ha is two-sided (greater OR less than the value for Ho), we want to know the probability represented by the following shaded area: 150 150 3250 3400 3550 “What are the chances of observing x as far away from the pop. mean m=3400 as the one we have (3250) in either direction” ?

  23. We want to compute: 150 150 3250 3400 3550 We know how to do this! We can transform the probability calculation into an equivalent one for a standard normal:

  24. When we use m = 3400, as presumed by Ho , the • resulting quantity is called a • a Test Statistic • More generally • if we let mo represent the value of m specified by Ho we have • Test Statistic:

  25. 5. Specify Decision Rule What is the probability of observing a sample mean as far away from mo as the mean we have observed?” This probability calculation is known as: the achieved significance or the significance of the data or the p-value

  26. Our decision rule might be • Reject Ho if the achieved significance is less than 0.05 • This is equivalent to saying, • If the probability of observing a sample mean, x, this far or farther from mo • is less than 5%, • then we will reject Ho in favor of Ha.

  27. Compute the test statistic from the sample data:

  28. The achieved significance (or P-value)is: -2.11 0 2.11

  29. Statistical Decision: • Since 0.0348 is less than 0.05 we will reject Ho. • We are saying that x = 3250 is sufficiently different from µo = 3400 • that it suggests that Ho is not true and should be abandoned. • That is, if Ho is true, the probability of a sample mean this far away is only .0348 or 3.5% – an unlikely outcome, so reject Ho.

  30. 8. Conclusion: • Hospital A has babies of significantly different birth weight than the US average. • In fact, the mean birth weight at Hospital A appears to be lower than the US mean.

  31. 9. Compute a Confidence Interval Estimate of the true mean birth weight for babies at Hospital A • We have all the ingredients to compute a confidence interval estimate: • x = 3250, s = 710, n=100 • since the true standard deviation is known we use: • z.975 = 1.96 for a 95% confidence interval: • x  z (s/n) = 3250  (1.96)(710/10) = 3250  139.2 • 95% CI: (3110.8 , 3389.2)

  32. Interpretation: The hypothesized mean mo = 3400 falls outside (above) the 95% confidence interval. It therefore seems likely that the mean birth weight at Hospital A is less than the overall US mean. Your confidence interval should give a consistent result with your hypothesis test. If it doesn’t – check your work!

  33. Comparing CI estimates and Hypothesis Testing • When conducting a hypothesis test, with an a=.05 decision rule, we are centering an interval around the hypothesized mean (m0): • When our observed sample mean (x) falls outside this interval, we interpret this as indicating, with 0.05 likelihood of error, that our sample comes from a distribution with a different mean x ?? m0-z.975s/n m0m0+z.975s/n

  34. COMMENTS: • The “.05 rule” alone is very uninformative • it leads to a “reject” or “do not reject” with no information about the data. • A better approach is to report both • the achieved significance • confidence interval estimate • You can then interpret these, while also leaving room for your reader to interpret.

  35. 2. Don’t forget the conclusion step! Too often, only a p-value is reported or, worse still, only a “reject” or “do not reject” is reported. 3. Statistical significance alone gives no clues about biology. Keep in mind that a standard error is a function of sample size n. This means that by increasing n, the SE can be made smaller and smaller.

  36. Eventually, any observation can achieve statistical significance regardless of its biological relevance. For example is a statistically significant change in blood pressure of 1 mm Hg very useful? If we have a very large n, say n=1000 we might find such a difference of 1mmhg statistically significant, but it may not be a biologically meaningful distinction.

  37. 4. A statistical hypothesis test uses probabilities based only on the null hypothesis (Ho)model! • The proof by contradiction thinking asks us to: • presume that Ho is true • then examine the plausibility of our data in light of this assumption. • We either reject it, or we fail to do so. We do not prove that Ho is correct.

  38. 5.We can summarize the results of statistical hypothesis testing as follows: NULL HYPOTHESIS Actually True Actually False Fail to Reject DECISION Reject

  39. IF Ho is true and we (incorrectly) reject Ho • we have type I error • we can calculate Pr[type I error] = a • IF Ha is true and we (incorrectly) fail to reject Ho • we have type II error • we must have a specific Ha model before • we can calculate Pr[type II error] = b • IF Ha is true and we (correctly) reject Ho • This occurs with probability = (1-b) • which we call the “POWER” of a test

  40. Example 2 • Does a new treatment for cancer increase the survival time from diagnosis significantly beyond 38.3 months? • A sample of 100 subjects given the new treatment had a mean survival time of 46.9 months. • Assume the data are a random sample of survival times from a N(m, s2) with s = 43.3 months. • (e.g., we may know the distribution of survival times from prior studies)

  41. SOLUTION. 2. Assumptions We have a random sample of n=100 survival times from a population with s = 43.3. Thus, 3. Specify Ho and Ha Research hypothesis suggests an increase in survival Ho: m£ 38.3 Ha: m > 38.3 (one sided!)

  42. 4. Specify Test Statistic: Since s = 43.3 is known, we’ll use • 5. Decision Rule • We’ll calculate z using observed data • compute the achieved significance (p-value) • and compare this to 0.05 • If it is less than 0.05 we will reject Ho • otherwise we will “fail to reject” Ho

  43. Calculations – Achieved significance • Be careful! For a one-sided test, we are concerned with a probability in only 1 direction from mo! .0233 46.9 38.3 z 1.986

  44. 7. Statistical Decision • .023 < .05  Reject Ho • 8. Conclusion • It is unlikely that the improvements in survival time are due to chance. The new treatment appears to significantly improves survival. • Confidence Interval on True Mean survival using new treatment: • z.975 = 1.96 for a 95% confidence interval, known s: • x  z (s/n) = 46.9  (1.96)(43.3/10) = 46.9  8.49 • 95% CI: (38.41, 55.39)

  45. A note on One-sided hypothesis tests: • Quite often, we are interested in a change in only one direction: • Does a new drug increase the proportion of patients cured? • Does a new policy decrease the hospital length of stay (LOS)? • A test that looks at a change in only one direction seems to make sense. • However in practice this is rarely done.

  46. If it is possiblefor the change to occur in either direction • then a test should look for the change in either direction. • For example, • the new drug could actually decrease the proportion of patients cured, • or the new policy could potentially result in increased LOS due to unexpected side effects. • Standard practice is to use a two-sided test!

  47. Recap of Significance Testing So Far • The Basic Idea • Compute the “probability of the data” (achieved significance) presuming Ho to be true. • Large Probabilities are consistent with Ho -- do not reject • Small Probabilities are NOT consistent with Ho -- reject

  48. “Probability of the Data” We want to know the probability of a sample statistic as extreme or more extreme than the one observed. One Sided Alternative Two Sided Alternative Distribution determined by Ho 0 0 t or z = observed sample statistic

  49. Next we will consider a couple of examples that parallel the situations we have discussed so far for confidence interval estimation. We will also focus on computer analysis for conducting hypothesis tests

  50. Application 1: One Population, s2 Known, Test ofhypothesis onmean, m • 1. Research Question: Serum enzyme A levels are measured in 10 patients with a sample mean of 22. If it is known that the population variance is 45 and if normality is assumed, are the data consistent with a population mean of 25? • That is, we have • n=10 • s2=45 • x=22 • mo=25

More Related