Question

In: Statistics and Probability

USE R CODING! Pleaseee I need the code With R coding Obs: it supposed to use...

USE R CODING! Pleaseee I need the code With R coding Obs: it supposed to use probability density function like X ~ Binomial( n ,p ) dbinom(X=?, n, prob) pbinom(X=?, n, prob) rbinmo(幾個符合二項分配的X, n, prob) X~Poisson (lamda) dpois(X=?, lamda) ppois (X=?, lamda) rpois (X, lamda)

**Suppose the random variable X obeys the binomial allocation B (n=100, p=0.1)

(a) Use X as the binomial allocation to calculate P(12≤X≤14)

(b) In practice, when np ≥ 5 and n(1-p) ≥ 5, X will approach normal assignment. E(X)=np, Var(X)=np(1-p), using this characteristic to calculate P(12≤X≤14), continuous correction is considered

(c) In practice, when n≥100 and np≤10, X will approach the Budisson distribution, E(X)=np, and use this characteristic to calculate P(12≤X≤14)

Solutions

Expert Solution

X follows  binomial distribution with n = 100 and p = 0.1

a) P(12≤X≤14) = P( x = 12) + P( x = 13 ) + P( x = 14 )

To find the binomial probability for exact value of x. we use function dbinom(x,n,p)

dbinom(12,100,0.1)+dbinom(13,100,0.1)+dbinom(14,100,0.1)
Answer : 0.2244

b) n*p = 10 and n*q = 90 both n*p and n*q are greater than 5 , so we can use normal approximation.

So mean = n*p = 10 and standard deviation = = = 3

Now we need to use continuity correction by subtraction 0.5 from 12 and adding 0.5 to 14

So P( 12-0.5 ≤X≤14+0.5)  

P( 11.5 ≤ X ≤14.5 ) = P( x ≤ 14.5 ) - P( x ≤ 11.5)

R code : pnorm(14.5,10,3,lower.tail = TRUE) - pnorm(11.5,10,3,lower.tail = TRUE)

Answer : 0.2417

c) We have n = 100 and np = 10 . so we can use Poisson approximation to binomial

So lambda = n*p = 10

P(12≤X≤14) = P( x = 12) + P( x = 13 ) + P( x = 14 )

To find the Poisson probability for exact value of x. we use function dpois(x, lambda)

R code : dpois(12,10)+dpois(13,10)+dpois(14,10)

Answer : 0.2198


Related Solutions

With R coding Obs: it supposed to use probability density function like X ~ Binomial( n...
With R coding Obs: it supposed to use probability density function like X ~ Binomial( n ,p ) dbinom(X=?, n, prob) pbinom(X=?, n, prob) rbinmo(幾個符合二項分配的X, n, prob) X~Poisson (lamda) dpois(X=?, lamda) ppois (X=?, lamda) rpois (X, lamda) Exercises 1) A food company produces canned food, and the weight of each can on the production line is in accordance with normal distribution. N (175, 102) (Unit: gram) (a) Specifications indicate that each can weight lless than 155, what is the possibility...
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer...
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer the question. (1) Conduct one-way ANOVA test to test if the mean of igf1 of each level of tanner are the same? (2) What is the mean of igf1 in each level of tanner? (3) If there is any difference, which ones appear to be different? (Use pairwise t test for each pair of level with bonferroni method)
Case Problem A Bipartisan Agenda for Change ( Need to Use R coding) In a study...
Case Problem A Bipartisan Agenda for Change ( Need to Use R coding) In a study conducted by Zogby International for the Demaocrat and Chronicile, more than 700 New Yorkrs were polled to dtermine whether the New York state government works. Respondent survyed were asked questions involving pay cuts for state legislators, restrictions on lobbyists, term limits for legislators, and whethr stat citizens should be able to put matters directly on the state ballot for a vote.The results regarding several...
COMPUTER CALCULATIONS: I need to know how to code in R for the solutions, not by...
COMPUTER CALCULATIONS: I need to know how to code in R for the solutions, not by hand. 2. Look at the data in Table 7.18 on page 368 of the textbook. These data are also given in the SAS code labeled “SAS_basketball_goal_data” and R code labeled basketball goal data . The dependent variable is goals and the independent variable is height of basketball players. Complete a SAS /R program and answer the following questions about the data set: (a) Does...
Coding in R Im trying to plot a histogram in R, and i know the basic...
Coding in R Im trying to plot a histogram in R, and i know the basic code for that, however, the code requires 2 plots coming from the same data set. for example, the voltage of an old process vs. a new process. is there any ways to seperate the 2 processes out from the data set to make 2 relative frequencyt histograms?
I need the code in SAS and R and outputs please 2. The data below come...
I need the code in SAS and R and outputs please 2. The data below come from a study investigating a method of measuring body composition, and give the body fat percentage (% fat), age and sex for 18 adults aged between 23 and 61 years. Source: Mazess, R.B., Peppler, W.W., and Gibbons, M. (1984) Total body composition by dual-photon (153GD) absorptiometry. American Journal of Clinical Nutrition, 40, 834-839. age % fat sex 23 9.5 male 23 27.9 female 27...
I have a code and it works and runs as it supposed too. What is the...
I have a code and it works and runs as it supposed too. What is the UML for it? Any help will be awesome. Thanks. import java.util.Scanner; public class StringToMorseCode { public static void main(String[] args){ Scanner input = new Scanner(System.in);    char[] letters = { ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6',...
JAVA CODE BEGINNERS, I already have the DEMO CLASS(NEED YOU TO USE), I need you to...
JAVA CODE BEGINNERS, I already have the DEMO CLASS(NEED YOU TO USE), I need you to use all methods, also switch statements. Write a Temperature class. The class will have three conversion methods: toCelsius(), toKelvin() and toFahrenheit(). These methods will return a Temperature in those three scales equal to the this temperature. Note that the value of this is not changed in these conversions. In addition to these three conversion methods the class will have methods add(Temperature), subtract(Temperature), multiply(Temperature), and...
R code Need assistance in getting this R code to run variables (Process) char ( Age)...
R code Need assistance in getting this R code to run variables (Process) char ( Age) char tmp <- expand.grid(Process = unique(words$Process),Age =unique(words$Age)) X <- model.matrix(~ factor(Process):factor(Age), data = tmp) glht(mod, linfct = X)
I need r code for the following: In each simulation case, 3000 independent Gaussian time series...
I need r code for the following: In each simulation case, 3000 independent Gaussian time series of length n = 20, 50, 200, 800. Thanks
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT