Part I:

A. Please explain normal, binomial, and poisson distributions in less than 4 sentences.

The normal distribution is a symmetric, unimodal, bell curve that is adjusted by the mean and standard deviation, with mean shifting the curve left or right and the standard deviation affecting the height and spread of the curve. Binomial distribution shows the likelihood of getting a specific number of successes in a select number of two-outcome trials. Poisson distribution shows the likelihood of a specific number of events happening within an interval of time assuming each individual in the population is independent.

B. Explain what the pdf and cdf of a distribution measures. Pick any of the three distributions (or a distribution from the list above that we have not covered in class), and provide some intuition as to if the pdf formula makes sense or not.

A Probability Density Function (PDF) describes the relative likelihood of a continuous random variable taking on a specific value, while a Cumulative Distribution Function (CDF) gives the probability that the variable is less than or equal to a given value.

The PDF of a normal distribution is:

\[f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^\frac{{-(x-\mu)^{2}}}{2\sigma^{2}}\]

μ is the mean of the distribution, and σ is the standard deviation. Subtracting the mean from your data point (x - μ) measures how far that specific value is from the center, and squaring it makes it so being above or below the mean has the same value. Dividing by the standard deviation determines the width of the curve, and converts the measurement as the number of standard deviations away from the mean. Putting the squared distance inside a negative exponent means that the probability of an event happening drops off extremely fast the further you get from the mean. Multiplying by 1 over the standard deviation time the square root of two times π forces the total area under the curve equal to 1.

C. What are the key parameters that define the 3 distributions above? Does R require these key parameters to be declared?

?dnorm
## starting httpd help server ... done
?dbinom
?dpois

In a normal distribution, the key parameters that define the distribution are the mean and standard deviation. In a binomial distribution, the key parameters are the number of independent trials and the probability of success on each trial. In a poisson distribution, the key parameter is the average number of events in a fixed interval of time. R requires all of these key parameters to be declared.

D. Give a few examples of situations that can be modeled with each of the 3 distributions above.

Normal distributions can be used to model variation within populations. For example, a normal distribution can be used to show the mean and standard deviation of heights of the people of a specific country. An example of a situation that can be modeled by a binomial distribution is coin flipping, such as the probabilities of a certain number of times the coin lands on heads within a certain number of flips. Poisson distribution can be used in situations such as for modeling the probabilities of numbers of accidents that occur at an intersection in a month.

E. Plot the distribution in part B. You can begin by reading up on the plot() function, and seeing the coded lecture examples -

x <- seq(-4, 4, length.out = 500)
y <- dnorm(x, mean = 0, sd = 1)
plot(x, y, type = "l",
     lwd = 2,
     col = "black",
     main = "Normal Distribution PDF",
     xlab = "x",
     ylab = "Density"
     )
x_shade <- seq(-1, 1, length.out = 200)
polygon(c(-1, x_shade, 1),
        c(0, dnorm(x_shade), 0),
        col = rgb(.25, .5, .75, .5),
        border = NA
        )


Part II:

Let’s assume that a hospital’s neurosurgical team performed N procedures for in-brain bleeding last year. x of these procedures resulted in death within 30 days. If the national proportion for death in these cases is, then is there evidence to suggest that your hospital’s proportion of deaths is more extreme than the national proportion?

Pick your own values of N, x, and π. x is necessarily less than or equal to N, and is a fixed probability of success. The probability should be greater than or equal to x.

Then model both as a binomial and a Poisson, and provide your R code solutions.

N <- 50
x <- 5
pi <- .15

binomial <- round(sum(dbinom(5:50, size = N, prob = pi)), digits = 4)
paste("The binomial probability is", binomial)
## [1] "The binomial probability is 0.8879"
poisson <- round(sum(dpois(5:50, lambda = N * pi)), digits = 4)
paste("The poisson probability is", poisson)
## [1] "The poisson probability is 0.8679"

Do you get similar answers or not under the two different distributional assumptions, and can you guess why?

The results were very similar between the two distributions, which makes sense because the poisson distribution is the binomial distribution as the number of trials approaches infinity while the probability of each trial approaches 0.