Question

In: Statistics and Probability

**Please work in R** In a group of students, there are 2 out of 18 that...

**Please work in R**

In a group of students, there are 2 out of 18 that are left-handed.

a. Assuming a low-informative prior probability distribution, find the posterior distribution of left-handed students in the population. Summarize your results with an estimation of the mean, median, mode, and a 95% credible interval. Plot your posterior probability distribution.

b. According to the literature, 5 to 20% of people are left-handed. Take this information into account in your prior probability and calculate a new posterior probability distribution. Summarize your results with an estimation of the mean, median, mode, and a 95% credible interval. Plot your posterior probability distribution.

Solutions

Expert Solution

This is the case of Binomial Likelihood and if the prior and posterior are in the same family then they are called conjugate distributions.

Now, given Binomial Prior the conjugate would be beta distribution. The posterior beta distribution is

Beta(y+alpha,N-y+beta)

where y is the no. of left handed students, N is the sample size, alpha & beta are the parameters of Beta distribution.

Here, y = 2 and N = 18 so, Prior is Uniform(0,1)which is Beta(1,1) and hence, Posterior is Beta(y+alpha,N-y+beta) =  Beta(3,17)

Posterior mean = (y+alpha)/(N+alpha+beta) = 0.15

Posterior Median =(y+alpha-1/3)/(N+alpha+beta-2/3) = 0.137931

Posterior Mode = (y+alpha-1)/(N+alpha+beta-2) = 0.11111

R-Script for Part A

> #---Part A
> a<-1
> b<-1
> y<-2
> N<-18
> mean <-(y+a)/(N+a+b)
> mean
[1] 0.15
> median<-(y+a-(1/3))/(N+a+b-(2/3))
> median
[1] 0.137931
> mode<-(y+a-1)/(N+a+b-2)
> mode
[1] 0.1111111
> p = seq(0,1, length=500)
> plot(p, dbeta(p, 3,17), ylab="density", type ="l", col=4,main = "Beta(3,17)")

Part B

Now, let the prior beta distribution has mean equal to 0.125 which is the mean of 0.05 and .20. For choosing new alpha & beta parameters with mean 0.125 let the pseudo sample size be n, so the alpha and beta parameters become n*0.125,n*(1-0.125). Let us suppose n=1000 so alpha and beta are 125 and 875 respectively.

Posterior is Beta(y+alpha,N-y+beta) =  Beta(127,891)

Posterior mean = (y+alpha)/(N+alpha+beta) = 0.1247544

Posterior Median =(y+alpha-1/3)/(N+alpha+beta-2/3) = 0.1245085

Posterior Mode = (y+alpha-1)/(N+alpha+beta-2) = 0.1417323

R-Script for Part B

> #---Part B
> aa<-127
> bb<-891
> amean<-aa/(aa+bb)
> amean
[1] 0.1247544
> amedian<-(aa-(1/3))/(aa+bb-(2/3))
> amedian
[1] 0.1245085
> amode<-(aa-1)/(bb-2)
> amode
[1] 0.1417323
> p = seq(0,1, length=500)
> plot(p, dbeta(p, 127,891), ylab="density", type ="l", col=4,main = "Beta(127,891)")


Related Solutions

In a group of students, there are 2 out of 18 that are left-handed. a. Assuming...
In a group of students, there are 2 out of 18 that are left-handed. a. Assuming a low-informative prior probability distribution, find the posterior distribution of left-handed students in the population. Summarize your results with an estimation of the mean, median, mode, and a 95% credible interval. Plot your posterior probability distribution. b. According to the literature, 5 to 20% of people are left-handed. Take this information into account in your prior probability and calculate a new posterior probability distribution....
Work out the products of the matrices E, R, R^2,R^3, A, B, C, D, and verify...
Work out the products of the matrices E, R, R^2,R^3, A, B, C, D, and verify that these products reproduce the multiplication table for the symmetries of the square, as expected. (Instead of computing all 64 products, compute “sufficiently many” products, and show that your computations suffice to determine all other products.)
A survey of a group of college students was done to find out how students get...
A survey of a group of college students was done to find out how students get to school for the school year. 15% of those surveyed were from out of state. Of those that were in-state, 56% used a car as their primary form of transport to school, 13% used a train and 18% used a bus. Of those that were from out of state, 29% used an airplane, 31% used a car, and 12% used the train. 1. What...
The clinical instructor has assigned a group of students to work with patients on a special...
The clinical instructor has assigned a group of students to work with patients on a special nursing unit that treats women with postpartum depression. The instructor assigns the following questions as part of the preclinical preparation. a) What is depression, and what is the current biogenic theory for the causes of depression? b) Describe the actions of these classes of antidepressants: TCA MAO inhibitors SSRI’s
Part 2– R work (must be done in R) Copy and paste your R code and...
Part 2– R work (must be done in R) Copy and paste your R code and output into a word document, along with your written answers to the questions, and upload to Canvas.   Follow these instructions to import the necessary dataset: Before opening the dataset needed for this problem, you’ll need to call the “car”package.  Run the following line of code: > library(car) Now you can import the “Prestige” dataset and use it to answer the question below. Name the data...
A group of 12 male and 16 female students is talking about going out for pizza....
A group of 12 male and 16 female students is talking about going out for pizza. If 50% of the male students actually go and 25% of the female students actually go, find the probability that a random student who goes out for pizza is female. Write your answer as a fraction in lowest terms or as a proportion rounded to 3 decimal places.
Data set for ages of students in stats class: 17, 18, 18, 18, 18, 18, 18,...
Data set for ages of students in stats class: 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,19, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 25, 25, 25, 26, 26, 27, 28, 28, 28, 28, 29, 29, 32, 36, 42 1) Find the standard deviation of the ages and use it to calculate a 95% confidence interval for the true mean age (be...
Data set for ages of students in stats class: 17, 18, 18, 18, 18, 18, 18,...
Data set for ages of students in stats class: 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,19, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 25, 25, 25, 26, 26, 27, 28, 28, 28, 28, 29, 29, 32, 36, 42 1) Suppose we are trying to use this sample to infer something about the ages of all PSU students. Explain why this is...
A college research group reported that 43​% of college students aged​ 18-24 would spend their spring...
A college research group reported that 43​% of college students aged​ 18-24 would spend their spring breaks relaxing at home in 2009. A sample of 165 college students was selected. Complete parts a through d below. a. Calculate the standard error of the proportion. σp = ​(Round to four decimal places as​ needed.) b. What is the probability that less than​ 40% of the college students from the sample spent their spring breaks relaxing at​ home? ​ P(Less than​ 40%...
Group 1: Control - 20, 14, 18, 16, 17, 17 Group 2: Psychodynamic - 20, 9,...
Group 1: Control - 20, 14, 18, 16, 17, 17 Group 2: Psychodynamic - 20, 9, 10, 15, 15, 15 Group 3: Rational-Emotive - 18, 7, 15, 9, 11, 12 Group 4: Behavior Modification - 15, 5, 6, 13, 12, 9 Use Tukey's HSD to compare the individual means. What is q critical (from Table L)? (1 point) What is MS within (a.k.a. MS error in some output)? (1 point) What is n? (1 point) Compute HSD. (1 point) Are...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT