Binomial Distribution n = 20, p = 0.3



Similar documents
Normal Approximation. Contents. 1 Normal Approximation. 1.1 Introduction. Anthony Tanbakuchi Department of Mathematics Pima Community College

Stats on the TI 83 and TI 84 Calculator

Mean = (sum of the values / the number of the value) if probabilities are equal

Lecture 2: Discrete Distributions, Normal Distributions. Chapter 1

Experimental Design. Power and Sample Size Determination. Proportions. Proportions. Confidence Interval for p. The Binomial Test

You flip a fair coin four times, what is the probability that you obtain three heads.

Lecture 8. Confidence intervals and the central limit theorem

The Normal Distribution. Alan T. Arnholt Department of Mathematical Sciences Appalachian State University

Review of Random Variables

Normal distribution. ) 2 /2σ. 2π σ

Section 5 Part 2. Probability Distributions for Discrete Random Variables

Notes on Continuous Random Variables

Chapter 5. Random variables

Chapter 3: DISCRETE RANDOM VARIABLES AND PROBABILITY DISTRIBUTIONS. Part 3: Discrete Uniform Distribution Binomial Distribution

Solutions to Homework 6 Statistics 302 Professor Larget

An Introduction to Basic Statistics and Probability

WHERE DOES THE 10% CONDITION COME FROM?

STT315 Chapter 4 Random Variables & Probability Distributions KM. Chapter 4.5, 6, 8 Probability Distributions for Continuous Random Variables

Variables. Exploratory Data Analysis

Sample Questions for Mastery #5

4. Continuous Random Variables, the Pareto and Normal Distributions

MATH 10: Elementary Statistics and Probability Chapter 5: Continuous Random Variables

The normal approximation to the binomial

Density Curve. A density curve is the graph of a continuous probability distribution. It must satisfy the following properties:

For a partition B 1,..., B n, where B i B j = for i. A = (A B 1 ) (A B 2 ),..., (A B n ) and thus. P (A) = P (A B i ) = P (A B i )P (B i )

EMPIRICAL FREQUENCY DISTRIBUTION

Table of Useful R commands

5. Continuous Random Variables

The normal approximation to the binomial

Probability Distribution for Discrete Random Variables

3.4 The Normal Distribution

This can dilute the significance of a departure from the null hypothesis. We can focus the test on departures of a particular form.

Probability and Statistics Vocabulary List (Definitions for Middle School Teachers)

Chapter 4. Probability and Probability Distributions

Bootstrap Example and Sample Code

BASIC STATISTICAL METHODS FOR GENOMIC DATA ANALYSIS

99.37, 99.38, 99.38, 99.39, 99.39, 99.39, 99.39, 99.40, 99.41, cm

The Binomial Probability Distribution

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Chapter 9 Monté Carlo Simulation

5/31/ Normal Distributions. Normal Distributions. Chapter 6. Distribution. The Normal Distribution. Outline. Objectives.

Chapter 5: Discrete Probability Distributions

Dongfeng Li. Autumn 2010

Probability Distributions

2 Binomial, Poisson, Normal Distribution

ECE302 Spring 2006 HW4 Solutions February 6,

TEACHER NOTES MATH NSPIRED

Lecture 6: Discrete & Continuous Probability and Random Variables

6.2 Normal distribution. Standard Normal Distribution:

Important Probability Distributions OPRE 6301

4.3 Areas under a Normal Curve

Lecture 2: Descriptive Statistics and Exploratory Data Analysis

STAT 315: HOW TO CHOOSE A DISTRIBUTION FOR A RANDOM VARIABLE

Continuous Random Variables

1.1 Introduction, and Review of Probability Theory Random Variable, Range, Types of Random Variables CDF, PDF, Quantiles...

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 18. A Brief Introduction to Continuous Probability

Key Concept. Density Curve

Probability Calculator

Chapter 4 Lecture Notes

Random variables, probability distributions, binomial random variable

MATH 10: Elementary Statistics and Probability Chapter 7: The Central Limit Theorem

The Normal distribution

Exploratory Data Analysis

Characteristics of Binomial Distributions

Normal Distribution. Definition A continuous random variable has a normal distribution if its probability density. f ( y ) = 1.

Joint Exam 1/P Sample Exam 1

16. THE NORMAL APPROXIMATION TO THE BINOMIAL DISTRIBUTION

Chapter 3 RANDOM VARIATE GENERATION

MATH4427 Notebook 2 Spring MATH4427 Notebook Definitions and Examples Performance Measures for Estimators...

Statistics I for QBIC. Contents and Objectives. Chapters 1 7. Revised: August 2013

Exploratory data analysis (Chapter 2) Fall 2011

Math 425 (Fall 08) Solutions Midterm 2 November 6, 2008

The Normal Distribution

Lesson 20. Probability and Cumulative Distribution Functions

Curriculum Map Statistics and Probability Honors (348) Saugus High School Saugus Public Schools

Lecture 3: Continuous distributions, expected value & mean, variance, the normal distribution

MBA 611 STATISTICS AND QUANTITATIVE METHODS

BA 275 Review Problems - Week 5 (10/23/06-10/27/06) CD Lessons: 48, 49, 50, 51, 52 Textbook: pp

Descriptive Statistics. Purpose of descriptive statistics Frequency distributions Measures of central tendency Measures of dispersion

Descriptive Statistics

6.4 Normal Distribution

ST 371 (IV): Discrete Random Variables

Sampling Distributions

Binomial Probability Distribution

Random Variables. Chapter 2. Random Variables 1

REPEATED TRIALS. The probability of winning those k chosen times and losing the other times is then p k q n k.

Probability density function : An arbitrary continuous random variable X is similarly described by its probability density function f x = f X

Calculating P-Values. Parkland College. Isela Guerra Parkland College. Recommended Citation

SOLUTIONS: 4.1 Probability Distributions and 4.2 Binomial Distributions

Homework 4 - KEY. Jeff Brenion. June 16, Note: Many problems can be solved in more than one way; we present only a single solution here.

PROBABILITY AND SAMPLING DISTRIBUTIONS

Lecture 7: Continuous Random Variables

AP Statistics Solutions to Packet 2

Bowerman, O'Connell, Aitken Schermer, & Adcock, Business Statistics in Practice, Canadian edition

Chapter 4 - Lecture 1 Probability Density Functions and Cumul. Distribution Functions

Two-Sample T-Tests Allowing Unequal Variance (Enter Difference)

November 08, S8.6_3 Testing a Claim About a Standard Deviation or Variance

MEASURES OF VARIATION

A review of the portions of probability useful for understanding experimental design and analysis.

WEEK #22: PDFs and CDFs, Measures of Center and Spread

Transcription:

This document will describe how to use R to calculate probabilities associated with common distributions as well as to graph probability distributions. R has a number of built in functions for calculations involving probability distributions, both discrete and continuous. This semester we will see the Binomial, Poisson, and Normal distributions early during our introduction to probability. Later, we will use the t, F, and chi-square distributions in our study of statistical inference. For each of these distributions (and others), R has four primary functions. Each function has a one letter prefix followed by the root name of the function. The names make mnemonic sense for continuous random variables but are used in both cases. For example dnorm is the height of the density of a normal curve while dbinom returns the probability of an outcome of a binomial distribution. Here is a table of these commands. Meaning Prefix Continuous Discrete d density probability (pmf) p probability (cdf) probability (cdf) q quantile quantile r random random Distribution Binomial Poisson Normal t F Chi-square Root binom pois norm t F chisq Graphing Probability Distributions. The file prob.r contains function that may be used to graph and visualize the binomial and normal distributions. Here are some examples of their use. > source("prob.r") > gbinom(20, 0.3) Binomial Distribution n = 20, p = 0.3 Probability 0.00 0.10 0 5 10 15 20 This plot will help visualize the probability of getting between 45 and 55 heads in 100 coin tosses. > gbinom(100, 0.5, a = 45, b = 55, scale = T)

Probability 0.00 0.04 0.08 Binomial Distribution n = 100, p = 0.5 P(45 <= Y <= 55) = 0.728747 30 40 50 60 70 The Binomial Distribution. The binomial distribution is applicable for counting the number of outcomes of a given type from a prespecified number n independent trials, each with two possible outcomes, and the same probability of the outcome of interest, p. The distribution is completely determined by n and p. The probability mass function is defined as: ( ) n Pr{Y = j} = p j (1 p) n j j where ( ) n = j n! j!(n j)! is called a binomial coefficient. (Some textbooks use the notation n C j instead.) In R, the function dbinom returns this probability. There are three required arguments: the value(s) for which to compute the probability (j), the number of trials (n), and the success probability for each trial (p). For example, here we find the complete distribution when n = 5 and p = 0.1. > dbinom(0:5, 5, 0.1) [1] 0.59049 0.32805 0.07290 0.00810 0.00045 0.00001 If we want to find the single probability of exactly 10 successes in 100 trials with p = 0.1, we do this. > dbinom(10, 100, 0.1) [1] 0.1318653

The function pbinom is useful for summing consecutive binomial probabilities. With n = 5 and p = 0.1, here are some example calcuations. Pr{Y 2} = pbinom(2,5,0.1). = 0.99144 Pr{Y 3} = 1 Pr{Y 2} = 1 pbinom(2,5,0.1). = 0.00856 Pr{1 Y 3} = Pr{Y 3} Pr{Y 0} = pbinom(3,5,0.1) pbinom(0,5,0.1). = 0.40905 We can also find the quantiles of a binomial distribution. For example, here is the 90th percentile of a binomial distribution with n = 200 and p = 0.3. The function qbinom finds the quantile. The function gbinom with option quantile = 0.9 graphs the distribution. > qbinom(0.9, 200, 0.3) [1] 68 > gbinom(200, 0.3, scale = T, quantile = 0.9) Probability 0.00 0.02 0.04 0.06 Binomial Distribution n = 200, p = 0.3 The 0.9 quantile = 68 40 50 60 70 80 The last function for the binomial distribution is used to take random samples. Here is a random sample of 20 binomial random variables drawn from the binomial distribution with n = 10 and p = 0.5. > rbinom(20, 10, 0.5) [1] 6 7 3 5 3 6 7 6 5 8 5 5 6 4 5 7 5 3 5 6 Normal distributions have symmetric, bell-shaped density curves that are described by two parameters: the mean µ and the standard deviation σ. The two points of a normal density curve that are the steepest at the shoulders of the curve are precisely one standard deviation above and below the mean.

Heights of individual corn plants may be modeled as normally distributed with a mean of 145 cm and a standard deviation of 22 cm (Samuels and Witmer, third edition, exercise 4.29). Here are several example normal calculations using R. The commands using gnorm allow you to visualize the answers. Find the proportion of plants:... larger than 100cm; > 1 - pnorm(100, 145, 22) [1] 0.979595 > gnorm(145, 22, a = 100) P( X < 100 ) = 0.0204 P( X > 100 ) = 0.9796... between 120cm and 150cm: > pnorm(150, 145, 22) - pnorm(120, 145, 22) [1] 0.461992 > gnorm(145, 22, a = 120, b = 150)

P( 120 < X < 150 ) = 0.462 P( X < 120 ) = 0.1279 P( X > 150 ) = 0.4101... 150cm or less: > pnorm(150, 145, 22) [1] 0.5898942 > gnorm(145, 22, b = 150) P( X < 150 ) = 0.5899 P( X > 150 ) = 0.4101 Find the 75th percentile. > qnorm(0.75, 145, 22)

[1] 159.8388 > gnorm(145, 22, quantile = 0.75) P( X < 159.8 ) = 0.75 z = 0.67 Find the endpoints of middle 95% of the distribution. > ab = qnorm(c(0.025, 0.975), 145, 22) > ab [1] 101.8808 188.1192 > gnorm(145, 22, a = round(ab[1], 1), b = round(ab[2], 1)) P( 101.9 < X < 188.1 ) = 0.9499 P( X < 101.9 ) = 0.0251 P( X > 188.1 ) = 0.0251

Other Distributions Other distributions work in a similar way, except that I have not yet written analogous graphing functions. Details on how to express the parameters for different probability distributions can be found from the help files. For example, to learn about find Poisson probabilities, type?dpois.