The Binomial Distribution

Similar documents
The Binomial Distribution

Random variables The binomial distribution The normal distribution Sampling distributions. Distributions. Patrick Breheny.

Random variables The binomial distribution The normal distribution Other distributions. Distributions. Patrick Breheny.

The Binomial Distribution

Lab #7. In previous lectures, we discussed factorials and binomial coefficients. Factorials can be calculated with:

The Central Limit Theorem

Binomial distribution

Chapter 7 presents the beginning of inferential statistics. The two major activities of inferential statistics are

Data Analysis and Statistical Methods Statistics 651

Probability & Statistics Chapter 5: Binomial Distribution

Sampling Distributions For Counts and Proportions

Review. Preview This chapter presents the beginning of inferential statistics. October 25, S7.1 2_3 Estimating a Population Proportion

Binomial Random Variable - The count X of successes in a binomial setting

(# of die rolls that satisfy the criteria) (# of possible die rolls)

Chapter 5. Sampling Distributions

MATH 446/546 Homework 1:

The Binomial distribution

Binomial Distributions

Homework: (Due Wed) Chapter 10: #5, 22, 42

chapter 13: Binomial Distribution Exercises (binomial)13.6, 13.12, 13.22, 13.43

The Binomial Distribution

Lecture 3. Sampling distributions. Counts, Proportions, and sample mean.

ASSIGNMENT 14 section 10 in the probability and statistics module

The Binomial Distribution

Binomial Distributions

Chapter 4 Probability Distributions

Sampling Distributions and the Central Limit Theorem

CHAPTER 6 Random Variables

A random variable is a (typically represented by ) that has a. value, determined by, A probability distribution is a that gives the

STAT243 LS: Intro to Probability and Statistics Final Exam, Mar 20, 2017 KEY

Part V - Chance Variability

***SECTION 8.1*** The Binomial Distributions

Chapter 8: Binomial and Geometric Distributions

Midterm Exam III Review

4.2 Bernoulli Trials and Binomial Distributions

Chapter 4. Section 4.1 Objectives. Random Variables. Random Variables. Chapter 4: Probability Distributions

binomial day 1.notebook December 10, 2013 Probability Quick Review of Probability Distributions!

ECON 214 Elements of Statistics for Economists 2016/2017

Chapter 1 Discussion Problem Solutions D1. D2. D3. D4. D5.

Equivalence Tests for One Proportion

Lesson 97 - Binomial Distributions IBHL2 - SANTOWSKI

Opening Exercise: Lesson 91 - Binomial Distributions IBHL2 - SANTOWSKI

2. Modeling Uncertainty

Math 14 Lecture Notes Ch. 4.3

Module 4: Probability

Stat 20: Intro to Probability and Statistics

Random Variables CHAPTER 6.3 BINOMIAL AND GEOMETRIC RANDOM VARIABLES

Probability Distributions: Discrete

Overview. Definitions. Definitions. Graphs. Chapter 4 Probability Distributions. probability distributions

The following content is provided under a Creative Commons license. Your support

CHAPTER 4 DISCRETE PROBABILITY DISTRIBUTIONS

S = 1,2,3, 4,5,6 occurs

The normal distribution is a theoretical model derived mathematically and not empirically.

Lecture 6 Probability

3: Balance Equations

Math 160 Professor Busken Chapter 5 Worksheets

The Binomial Probability Distribution

MVE051/MSG Lecture 7

Week 2 Quantitative Analysis of Financial Markets Hypothesis Testing and Confidence Intervals

Introduction to Probability and Inference HSSP Summer 2017, Instructor: Alexandra Ding July 19, 2017

Experimental Probability - probability measured by performing an experiment for a number of n trials and recording the number of outcomes

Binomial Random Variables

Probability and Sample space

Name Period AP Statistics Unit 5 Review

Binomial Probability

7. For the table that follows, answer the following questions: x y 1-1/4 2-1/2 3-3/4 4

4: Probability. Notes: Range of possible probabilities: Probabilities can be no less than 0% and no more than 100% (of course).

Math 361. Day 8 Binomial Random Variables pages 27 and 28 Inv Do you have ESP? Inv. 1.3 Tim or Bob?

Statistical Methods in Practice STAT/MATH 3379

Section 6.3 Binomial and Geometric Random Variables

Chapter 6: Random Variables

3.2 Hypergeometric Distribution 3.5, 3.9 Mean and Variance

INTRODUCTION TO MATHEMATICAL MODELLING LECTURES 3-4: BASIC PROBABILITY THEORY

Random Variables. 6.1 Discrete and Continuous Random Variables. Probability Distribution. Discrete Random Variables. Chapter 6, Section 1

SHOULD COMPENSATION SCHEMES BE BASED ON THE PROBABILITY OF CAUSATION OR EXPECTED YEARS OF LIFE LOST?

Chapter 4 Discrete Random variables

E509A: Principle of Biostatistics. GY Zou

14.30 Introduction to Statistical Methods in Economics Spring 2009

Multinomial Coefficient : A Generalization of the Binomial Coefficient

6.1 Binomial Theorem

Chapter 8 Estimation

Chapter 5 Probability Distributions. Section 5-2 Random Variables. Random Variable Probability Distribution. Discrete and Continuous Random Variables

Chapter 8. Binomial and Geometric Distributions

Lecture Slides. Elementary Statistics Tenth Edition. by Mario F. Triola. and the Triola Statistics Series

Probability. An intro for calculus students P= Figure 1: A normal integral

Tests for the Odds Ratio in a Matched Case-Control Design with a Binary X

Discrete Probability Distributions

Chapter 4 Discrete Random variables

Ex 1) Suppose a license plate can have any three letters followed by any four digits.

Binomial Distributions

STA2601. Tutorial letter 105/2/2018. Applied Statistics II. Semester 2. Department of Statistics STA2601/105/2/2018 TRIAL EXAMINATION PAPER

Chapter 14 : Statistical Inference 1. Note : Here the 4-th and 5-th editions of the text have different chapters, but the material is the same.

MATH 227 CP 6 SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.

Section Sampling Distributions for Counts and Proportions

5.1 Personal Probability

Chapter 6: Random Variables

CHAPTER 5 Sampling Distributions

ECO220Y Estimation: Confidence Interval Estimator for Sample Proportions Readings: Chapter 11 (skip 11.5)

Chapter 9 Chapter Friday, June 4 th

Portfolio Analysis with Random Portfolios

Transcription:

The Binomial Distribution Patrick Breheny February 16 Patrick Breheny STA 580: Biostatistics I 1/38

Random variables The Binomial Distribution Random variables The binomial coefficients The binomial distribution So far, we have discussed the probability of single events In research, however, the data we collect consists of many events (for each subject, does he/she contract polio?) We then summarize those events with a number (out of the 200,000 people who got the vaccine, how many contracted polio?) Such a number is an example of a random variable Patrick Breheny STA 580: Biostatistics I 2/38

Distributions The Binomial Distribution Random variables The binomial coefficients The binomial distribution In our sample, we observe a certain value of a random variable In order to assess the variability of that value, we need to know the chances that our random variable could have taken on different values depending on the true values of the population parameters This is called a distribution A distribution describes the probability that a random variable will take on a specific value or fall within a specific range of values Patrick Breheny STA 580: Biostatistics I 3/38

Examples The Binomial Distribution Random variables The binomial coefficients The binomial distribution Random variable Possible outcomes # of copies of a genetic mutation 0,1,2 # of children a woman will have in her lifetime 0,1,2,... # of people in a sample who contract polio 0,1,2,...,n Patrick Breheny STA 580: Biostatistics I 4/38

Listing the ways The Binomial Distribution Random variables The binomial coefficients The binomial distribution When trying to figure out the probability of something, it is sometimes very helpful to list all the different ways that the random process can turn out If all the ways are equally likely, then each one has probability, where n is the total number of ways 1 n Thus, the probability of the event is the number of ways it can happen divided by n Patrick Breheny STA 580: Biostatistics I 5/38

Genetics example The Binomial Distribution Random variables The binomial coefficients The binomial distribution For example, the possible outcomes of an individual inheriting cystic fibrosis genes are CC Cc cc cc If all these possibilities are equally likely (as they would be if the individual s parents had one copy of each version of the gene), then the probability of having one copy of each version is 2/4 Patrick Breheny STA 580: Biostatistics I 6/38

Coin example The Binomial Distribution Random variables The binomial coefficients The binomial distribution Another example where the outcomes are equally likely is flips of a coin Suppose we flip a coin three times; what is the probability that exactly one of the flips was heads? Possible outcomes: HHH HHT HT H HT T T HH T HT T T H T T T The probability is therefore 3/8 Patrick Breheny STA 580: Biostatistics I 7/38

The binomial coefficients Random variables The binomial coefficients The binomial distribution Counting the number of ways something can happen quickly becomes a hassle (imagine listing the outcomes involved in flipping a coin 100 times) Luckily, mathematicians long ago discovered that when there are two possible outcomes that occur/don t occur n times, the number of ways of one event occurring k times is n! k!(n k)! The notation n! means to multiply n by all the positive numbers that come before it (e.g. 3! = 3 2 1) Note: 0! = 1 Patrick Breheny STA 580: Biostatistics I 8/38

Random variables The binomial coefficients The binomial distribution Calculating the binomial coefficients For the coin example, we could have used the binomial coefficients instead of listing all the ways the flips could happen: 3! 1!(3 1)! = 3 2 1 2 1(1) = 3 Many calculators and computer programs (including R and SAS) have specific functions for calculating binomial coefficients, which we will explore in lab Patrick Breheny STA 580: Biostatistics I 9/38

Random variables The binomial coefficients The binomial distribution When sequences are not equally likely Suppose we draw 3 balls, with replacement, from an urn that contains 10 balls: 2 red balls and 8 green balls What is the probability that we will draw two red balls? As before, there are three possible sequences: RRG, RGR, and GRR, but the sequences no longer have probability 1 8 Patrick Breheny STA 580: Biostatistics I 10/38

Random variables The binomial coefficients The binomial distribution When sequences are not equally likely (cont d) The probability of each sequence is 2 10 2 10 8 10 = 2 10 8 10 2 10 = 8 10 2 10 Thus, the probability of drawing two red balls is 3 2 10 2 10 8 10 = 9.6% 2 10.03 Patrick Breheny STA 580: Biostatistics I 11/38

The binomial formula Random variables The binomial coefficients The binomial distribution This line of reasoning can be summarized in the following formula: the probability that an event will occur k times out of n is n! k!(n k)! pk (1 p) n k In this formula, n is the number of trials, p is the probability that the event will occur on any particular trial We can then use the above formula to figure out the probability that the event will occur k times Patrick Breheny STA 580: Biostatistics I 12/38

Example The Binomial Distribution Random variables The binomial coefficients The binomial distribution According to the CDC, 22% of the adults in the United States smoke Suppose we sample 10 people; what is the probability that 5 of them will smoke? We can use the binomial formula, with 10! 5!(10 5)!.225 (1.22) 10 5 = 3.7% Patrick Breheny STA 580: Biostatistics I 13/38

Example (cont d) The Binomial Distribution Random variables The binomial coefficients The binomial distribution What is the probability that our sample will contain two or fewer smokers? We can add up probabilities from the binomial distribution: P (x 2) = P (x = 0) + P (x = 1) + P (x = 2) =.083 +.235 +.298 = 61.7% Patrick Breheny STA 580: Biostatistics I 14/38

Random variables The binomial coefficients The binomial distribution The binomial formula when to use This formula works for any random variable that counts the number of times an event occurs out of n trials, provided that the following assumptions are met: The number of trials n must be fixed in advance The probability that the event occurs, p, must be the same from trial to trial The trials must be independent If these assumptions are met, the random variable is said to follow a binomial distribution, or to be binomially distributed Patrick Breheny STA 580: Biostatistics I 15/38

One-sample categorical data The binomial distribution plays a central role in the analysis of one-sample categorical data For example, a study at Johns Hopkins estimated the survival chances of infants born prematurely by surveying the records of all premature babies born at their hospital in a three-year period In their study, they found 39 babies who were born at 25 weeks gestation, 31 of which survived at least 6 months Patrick Breheny STA 580: Biostatistics I 16/38

One-sample categorical data (cont d) This type of study has one sample of 39 babies If some of these babies had received one type of therapy and the rest a different kind of therapy, and we were interested in comparing the two therapies, then we would have two samples The outcome of this study is categorical, in that a baby either survived for 6 months or it didn t If we had instead decided to measure lung function or weight or some continuous measure of health, we would have continuous data As we will see, recognizing how many samples there are, and what kind of data the outcome is, plays a central role in the proper way to analyze that study Patrick Breheny STA 580: Biostatistics I 17/38

Generalization to the population The Johns Hopkins study observed that 31/39 = 79.5% of babies survive after being born at 25 weeks gestation The goal of the study was not to audit their hospital s performance, but to estimate the percent of babies in other (comparable) hospitals, in future years (although maybe not too far in the future), that would survive early labor This is the generalization they want to make, but how accurate is their percentage? Could the actual percent of babies who would survive such an early labor (in other hospitals, in future years) be as high as 95%? As low as 50%? Patrick Breheny STA 580: Biostatistics I 18/38

Confidence interval The number of infants who survive will follow a binomial distribution Let p denote the probability that an infant will survive, let p 0 denote the true, unknown value of that probability, and let ˆp =.795 equal our estimate of that probability based on our sample (this is common notation in statistics to distinguish parameters from estimates) In order to build a 95% confidence interval, we need a way to calculate two numbers, (p L, p U ) that have a 95% probability of containing p 0 The most natural way of doing this is to find p L so that we only have a 2.5% probability of getting ˆp or higher, and p U so that there is only a 2.5% probability of obtaining ˆp or lower Patrick Breheny STA 580: Biostatistics I 19/38

Trial and error The Binomial Distribution Let s start by trying out the value p L =.5 If p 0 =.5, what is the probability that 31 or more babies (out of 39) would survive? Letting X denote the number of babies who survive, P (X 31) = P (X = 31) + P (X = 32) +... = 39! 31!8!.531 (1.5) 8 +... =.000112 +.000028 +... =.00015 This is much lower than the 2.5% we were shooting for; we need to raise p L Patrick Breheny STA 580: Biostatistics I 20/38

Finding p L and p U This sort of trial and error is tedious to do by hand, but trivial for a computer: P(p^ or higher) 0.00 0.04 0.08 0.12 P(p^ or higher) 0.00 0.05 0.10 0.15 0.20 0.50 0.55 0.60 0.65 0.70 p 0.86 0.88 0.90 0.92 0.94 p Patrick Breheny STA 580: Biostatistics I 21/38

Confidence interval results Thus, our confidence interval for the (population) percentage of infants who survive after being born at 25 weeks is (63.5%,90.7%) In their study, the Johns Hopkins researchers also found 29 infants born at 22 weeks gestation, none of which survived 6 months Applying the same procedure, we obtain the following confidence interval for the percentage of infants who survive after being born at 22 weeks: (0%,11.9%) Patrick Breheny STA 580: Biostatistics I 22/38

One-sample hypothesis tests It is relatively rare to have specific hypotheses in one-sample studies One very important exception is the collection of paired samples In a paired sampling design, we collect n pairs of observations and analyze the difference between the pairs Patrick Breheny STA 580: Biostatistics I 23/38

Hypothetical example: A sunblock study Suppose we are conducting a study investigating whether sunblock A is better than sunblock B at preventing sunburns The first design that comes to mind is probably to randomly assign sunblock A to one group and sunblock B to a different group This is nothing wrong with this design, but we can do better Patrick Breheny STA 580: Biostatistics I 24/38

Signal and noise The Binomial Distribution Generally speaking, our ability to make generalizations about the population depends on two factors: signal and noise Signal is the magnitude of the difference between the two groups in the present context, how much better one sunblock is than the other Noise is the variability present in the outcome from all other sources besides the one you re interested in in the sunblock experiment, this would include factors like how sunny the day was, how much time the person spent outside, how easily the person burns, etc. Hypothesis tests depend on the ratio of signal to noise how easily we can distinguish the treatment effect from all other sources of variability Patrick Breheny STA 580: Biostatistics I 25/38

Signal to noise ratio To get a larger signal-to-noise ratio, we must either increase the signal or reduce the variability The signal is usually determined by nature and out of our control Instead, we are going to have to reduce the variability/noise If our sunblock experiment were controlled, we could attempt such steps as forcing all participants to spend an equal amount of time outside, on the same day, in an equally sunny area, etc. Patrick Breheny STA 580: Biostatistics I 26/38

Person-to-person variability But what can be done about person-to-person variability (how easily certain people burn)? A powerful technique for reducing person-to-person variability is pairing For each person, we can apply sunblock A to one of their arms, and sunblock B to the other arm, and as an outcome, look at the difference between the two arms In this experiment, the items that we randomly sample from the population are pairs of arms belonging to the same person Patrick Breheny STA 580: Biostatistics I 27/38

Benefits of paired designs What do we gain from this? As variability goes down, become narrower Hypothesis tests become more powerful Patrick Breheny STA 580: Biostatistics I 28/38

More examples The Binomial Distribution Investigators have come up with all kinds of clever ways to use pairing to cut down on variability: Crossover studies Family studies Split-plot experiments Patrick Breheny STA 580: Biostatistics I 29/38

Pairing in observational studies Pairing is also widely used in observational studies Twin studies Matched studies In a matched study, the investigator will pair up ( match ) subjects on the basis of variables such as age, sex, or race, then analyze the difference between the pairs In addition to increasing power, pairing in observational studies also eliminates (some of the) potential confounding variables Patrick Breheny STA 580: Biostatistics I 30/38

Cystic fibrosis experiment As an example of a paired study, we will look at a crossover study of the drug amiloride as a therapy for patients with cystic fibrosis Cystic fibrosis is a fatal genetic disease that affects the lungs Forced vital capacity (FVC) is the volume of air that a person can expel from the lungs in 6 seconds FVC is a measure of lung function, and is often used as a marker of the progression of cystic fibrosis Patrick Breheny STA 580: Biostatistics I 31/38

Design of the cystic fibrosis experiment There were 14 people who participated in the study Each participant in the trial received both the drug and the placebo (at different times), crossing over to receive the other treatment halfway through the trial Like all well-designed crossover trials, the therapy (treatment/placebo) that each participant received first was chosen at random Furthermore, there was a washout period during the crossover between the two drug periods Patrick Breheny STA 580: Biostatistics I 32/38

The outcome The Binomial Distribution To determine an outcome, the FVC of the patients was measured at the beginning of each treatment period, and again at the end The outcome is the reduction in lung function over the treatment period So, for example, if a patient s FVC was 900 at the beginning of the drug period and 850 at the end, the reduction is 50 In the actual study, 11 of the 14 patients did better on the drug than on the placebo A hypothesis test informs us whether or not this kind of result could be due to chance alone Patrick Breheny STA 580: Biostatistics I 33/38

The null hypothesis The null hypothesis here is that the drug provides no benefit that whether the patient received drug or placebo has no impact on their lung function Under the null hypothesis, then, the probability that a patient does better on drug than placebo (p) is 50% So the null hypothesis is that p 0 =.5 Essentially, under the null, whether a patient does better on one treatment or another is like flipping a coin Patrick Breheny STA 580: Biostatistics I 34/38

The Binomial Distribution One way to test this null hypothesis would be to flip a coin 14 times, count the number of heads, and repeat this over and over again to see how unusual 11 heads is However, this is unnecessary, as we already have the binomial distribution to calculate these probabilities for us Under the null hypothesis, the number of patients who do better on the drug than placebo (X) will follow a binomial distribution with n = 14 and p = 0.5 This approach to hypothesis testing goes by several names, and could be called the exact test, the binomial test, or the sign test What we need to do is calculate the p-value: the probability of obtaining results as extreme or more extreme than the one observed in the data, given that the null hypothesis is true Patrick Breheny STA 580: Biostatistics I 35/38

As extreme or more extreme The result observed in the data was that 11 patients did better on the drug But what exactly is meant by as extreme or more extreme than 11? It is uncontroversial that 11, 12, 13, and 14 are as extreme or more extreme than 11 But what about 0? Is that more extreme than 11? Under the null, P (11) = 2.2%, while P (0) =.006% So 0 is more extreme than 11, but in a different direction Patrick Breheny STA 580: Biostatistics I 36/38

One-sided vs. two-sided tests Potentially, then, we have two different approaches to calculating this p-value: Find the probability that x 11 Find the probability that x 11 x 3 (the number that is as far away from the expected value of 7 as 11 is, but in the other direction) These are both reasonable things to do, and intelligent people have argued both sides of the debate However, the statistical and scientific community has for the most part come down in favor of the latter the so called two-sided test For this class, all of our tests will be two-sided tests Patrick Breheny STA 580: Biostatistics I 37/38

The Binomial Distribution Thus, the p-value of the sign test is p = P (x 3) + P (x 11) = P (x = 0) + + P (x = 3) + P (x = 11) + + P (x = 14) =.006% +.09% +.6% + 2.2% + 2.2% +.6% +.09% +.006% = 5.7% Seeing 11 out of 14 patients do better on one treatment than another is therefore reasonably unlikely This is moderate evidence against the null hypothesis Patrick Breheny STA 580: Biostatistics I 38/38