Question

In: Statistics and Probability

Solve following using Program R studio. Please show code and results. Thank you. 1. Assume that...

Solve following using Program R studio. Please show code and results. Thank you.

1. Assume that ? is a random variable follows binomial probability distribution with parameters 15 and 0.25.  

a. Simulate 100 binomial pseudorandom numbers from the given distribution (using set.seed(200)) and assign them to vector called binran.

b. Calculate ?(? < 8) using cumulative probability function.

c. Calculate ?(? = 8) using probability distribution function.

d. Calculate the average of simulated data and compare it with the corresponding theoretical value.

e. Calculate the variance of simulated data and compare it with the corresponding theoretical value.

f. Calculate 95th percentile of ? using quantile function.

Solutions

Expert Solution

(a)

Given that Y is a random variable which follows binomial probability distribution with parameters 15 and 0.25.

15 is the number of trials and 0.25 is the probability of success.

100 pseudorandom numers have to be generated from the given distriibution

The function rbin(n , size ,prob)

where n is the number of values to be generated , size is the number of trials and prob is the probabilty of success

The above command generates 100 random numbers folowing binomial distribution with parameters 15 and 0.25

On execution of the following command we get the follwing output

(b) The vector binran contain 100 pseudo random numbers .

The P(Y<8) has to be calculated using the cumulative distribution function.

The pbinom function is used to calculate the cumulative probability.

pbinom(q,size,prob, lower.tail=TRUE)

On execution of the following command

(c) To calculate the probability P(X= 8 )

we use the function dbinom(x,size,prob)

On execution of the above command ,

(d) The average of the simulated binomail random variable is calculated as

On execution of the above command , the following output is obtained

The average value obtained is 0.17 which is less than the true value of the parameter.

(e) The variance of the simulated data is calculated as

On execution of the above command , we get the following output

(e) To obtain the 95th percentile using the quantile function

On execution of the above command we get the following output


Related Solutions

Solve following using Program R studio. Please show code and results. Thank you. 3. Assume that...
Solve following using Program R studio. Please show code and results. Thank you. 3. Assume that ? is a random variable represents lifetime of a certain type of battery which is exponentially distributed with mean 60 hours.   a. Simulate 500 pseudorandom numbers (using set.seed(10)) and assign them to a vector called expran. b. Calculate average of simulated data and compare it with corresponding theoretical value. c. Calculate probability that lifetime is less than 50 hours using cumulative probability function. d....
Using R-Studio please answer the following questions and show your code. 1. Julie buys a take-out...
Using R-Studio please answer the following questions and show your code. 1. Julie buys a take-out coffee from one of two coffee shops on a random basis: Ultimo Coffee and Joe’s Place. This month, she measured the temperature of each cup immediately after purchase, using a cooking thermometer. Sample data is shown below, temperatures are in Fahrenheit. ultimo =  c(171,161,169,179, 171,166,169,178,171, 165,172,172) joes = c(168,165,172, 151,162,158,157,160, 158,160,158,164) State the null and alternative hypothesis in your own words. What type of statistical...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2 Suppose that fasting plasma glucose concentrations (FPG) in some population are normally distributed with a mean...
Please answer everything in R programming language. Show the code to me as well. Thank You...
Please answer everything in R programming language. Show the code to me as well. Thank You 1. Problem Open dataset stat500. Package: faraway. Use R (a) Calculate the correlation matrix. 10. (b) Plot total vs hw, to see how strong the relationship. (c) Build a simple linear regression: total regressed against midterm. Print model output. (d) Calculate directly the coefficients as in (3) (e) Calculate the Residual standard error s, as in (4). (f) Calculate the standard error of beta_1,...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE (SHOW ANSWERS IN R MARKDOWN FORWAT WITH CODE AND ANSWERS) PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2...
1. Basic use of R/R Studio. Solve the following problem in R and print out the...
1. Basic use of R/R Studio. Solve the following problem in R and print out the commands and outputs. (a) Create a vector of the positive odd integers less than 100; Remove the values greater than 60 and less than 80; Find the variance of the remaining set of values (b) What’s the difference in output between the commands 2*1:5 and (2*1):5? Why is there a difference? (c) If you wanted to enter the odd numbers from 1 to 19...
*Please provide r studio code/file* 1) Find the equation of the best fit line using least...
*Please provide r studio code/file* 1) Find the equation of the best fit line using least squares linear fit of x,y: set.seed(88) x <- 1:100 y <- jitter(1.5*x+8,amount=10) 2) For question 1, Draw the P=0.95 prediction intervals for y when x=1:150 3) For question 1, Find the equation of the best fit line using median-based linear fit of x,y. 4) For question 3, draw the P=0.95 prediction interval for y # when x=1:150
Please use R studio, Thank you. 2. The probability of a student passing statistics is known...
Please use R studio, Thank you. 2. The probability of a student passing statistics is known to be 0.41; and the probability of a student passing chemistry is known to be 0.55. If the probability of passing both is known to be 0.35, calculate: (a) the probability of passing at least one of statistics and chemistry (b) the probability of a student passing chemistry, given that they passed statistics (c) Are passing chemistry and statistics independent? Justify (d) (harder) a...
Please use R program and explain clealry please. thank you. 1. In NZ supermarkets, the average...
Please use R program and explain clealry please. thank you. 1. In NZ supermarkets, the average weight of a banana is 120 grams. An agricultural scientist buys bananas from a supermarket. Their weight, in grams, is as follows: c(103.2, 95.2, 89.6, 98.5, 112.8, 111) She suspects that this sample of bananas is lighter than average and wonders if this supermarket is selling bananas that are lighter than the NZ average. (a) State a sensible null hypothesis (b) State the precise...
Can You please Answer the question using R studio and R cloud Telomeres are complexes of...
Can You please Answer the question using R studio and R cloud Telomeres are complexes of DNA and protein that cap chromosomal ends. They consist of the same short DNA sequence TTAGGG repeated over and over again. They tend to shorted with cell divisions and with advancing cellular age, which will lead to chromosome instability or apoptosis (programmed cell death). Eukaryotic cells have the ability to reverse telomere shortening by expressing telomerase, an enzyme that extends the telomeres of chromosomes....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT