6: Binomial Probability Distributions Chapter 6 5/13/2019 6: Binomial Probability Distributions 6.1 Binomial Random Variables 6.2 Calculating Binomial Probabilities 6.3 Cumulative Probabilities 6.4 Probability Calculators 6.5 Expected Value and Variance of Binomial Random Variables 6.6 Using the Binomial Distribution to Help Make Judgments 5/13/2019 6: Binomial Distributions Basic Biostat
6.1 Binomial Random Variables Most popular type of discrete random variable Binomial random variables are based on a series on independent Bernoulli trials Bernoulli trial a random event characterized by “success” or “failure” Examples Coin flip (heads or tails) Survival following cancer (yes or no) Treatment outcome (success or failure) 5/13/2019 6: Binomial Distributions
Binomial random variables (cont.) The binomial distributions are a family of distributions identified by these parameters n number of trials p probability of success for each trial Let X represent the random number of successes in n independent Bernoulli trials Notation: X~b(n,p) means “X is distributed as a binomial with parameters n and p” “Four Patients” Illustrative Example: A treatment is successful 75% of time (p = 0.75). We use it in 4 patients (n = 4). The random number of success in each set of four, X, varies according to this binomial distribution: X~b(4, 0.75) 5/13/2019 6: Binomial Distributions
6.2 Calculating Binomial Probabilities The probability X equals x is … Where nCx = the binomial coefficient (next slide) p = probability of success for each trial q = probability of failure = 1 – p 5/13/2019 6: Binomial Distributions
Binomial Coefficient (“Choose Function”) where ! the factorial function: x! = x (x – 1) (x – 2) … 1 Example: 4! = 4 3 2 1 = 24 By definition 1! = 1 and 0! = 1 nCx the number of ways to choose i items out of n Example: “4 choose 2”: 5/13/2019 6: Binomial Distributions
6: Binomial Distributions Binomial Calculation Recall the four patients random variable X~b(4, 0.75) Note: q = 1 − 0.75 = 0.25 What is probability of 0 successes? Pr(X = 0) =nCx px qn–x = 4C0 · 0.750 · 0.254–0 = 1 · 1 · 0.0039 = 0.0039 5/13/2019 6: Binomial Distributions
6: Binomial Distributions X~b(4,0.75), continued Pr(X = 1) = 4C1 · 0.751 · 0.254–1 = 4 · 0.75 · 0.0156 = 0.0469 Pr(X = 2) = 4C2 · 0.752 · 0.254–2 = 6 · 0.5625 · 0.0625 = 0.2106 5/13/2019 6: Binomial Distributions
6: Binomial Distributions X~b(4, 0.75) continued Pr(X = 3) = 4C3 · 0.753 · 0.254–3 = 4 · 0.4219 · 0.25 = 0.4219 Pr(X = 4) = 4C4 · 0.754 · 0.254–4 = 1 · 0.3164 · 1 = 0.3164 5/13/2019 6: Binomial Distributions
6: Binomial Distributions pmf for X~b(4, 0.75) Tabular form Graphical form Successes Probability 0.0039 1 0.0469 2 0.2109 3 0.4210 4 0.3164 5/13/2019 6: Binomial Distributions
Area Under The Curve (AUC) The area under the curve represents probability Pr(X = 2) = 1 × .2109 5/13/2019 6: Binomial Distributions
6.3 Cumulative Probabilities Cumulative probability = the probability of that value or less (similar in concept to cumulative frequency as studied in Chapter 3) Denoted Pr(X x) Illustrative example: Cumulative probability function (cdf) for X~b(4, 0.75) Pr(X 0) = Pr(X = 0) = .0039 Pr(X 1) = Pr(X 0) + Pr(X = 1) = .0039 + .0469 = 0.0508 Pr(X 2) = Pr(X 1) + Pr(X = 2) = .0508 + .2109 = 0.2617 Pr(X 3) = Pr(X 2) + Pr(X = 3) = .2617 + .4219 = 0.6836 Pr(X 4) = Pr(X 3) + Pr(X = 4) = .6836 + .3164 = 1.0000 5/13/2019 6: Binomial Distributions
Cumulative Probability Cumulative probability = AUC in left tail Area under shaded bars in left tail represents: Pr(X 2) = 0.2617 Bring it on! 5/13/2019 6: Binomial Distributions
6.5 Expected Value and Variance These are shortcut formulas apply only to binomial random variables Four patients illustrative example X~b(4,0.75) μ = np = 4∙0.75 = 3 σ2 = npq = 4∙0.75∙0.25 = 0.75 σ = √σ2 = √0.75 = 0.866 Mean (expected value) Variance Standard deviation 5/13/2019 6: Binomial Distributions
6.6 Using the Binomial to help with Judgments For the four patients example, we expect 3. Suppose we observe 2 successes Does this cast doubt on p = 0.75? ANS: No, because Pr(X 2) = 0.2617 is not small 5/13/2019 6: Binomial Distributions
6: Binomial Distributions Using R dbinom(x,n,p) = P(X = x) , 0<= x <= n pbinom(x,n,p) = P(X <= x) 0<= x <= n 1-pbinom(x,n,p) = P(X > x) 0<= x <= n rbinom(N,n,p) generates N random binomial observations with parameters n and p. 5/13/2019 6: Binomial Distributions