I am trying to use qbinom to solve this problem but I am stuck in the loop part
ID: 3298962 • Letter: I
Question
I am trying to use qbinom to solve this problem but I am stuck in the loop part
Your task is to ask the user for input for n, where n is the number of trials in the binomial distribution. Based on the user's input your task I to generate a binomial probability table as shown in http://www.statisticshowto.com/tables/binomial-distribution-tablel. For example, if the user inputs 4, your output should look like the following: n=4 X0.05 0.1 0.1S 0.20.25 0.3 0.35 0.40.45 0.5 0.55 0.60.65 0.7 0.75 0.815 0.656 0.522 0.410 0.316 0.240 0.179 0.130 0.092 0.062 0.041 0.026 0.015 0.008 0.004 0.986 0.948 0.890 0819 0.738 0.652 0.563 0.475 0.391 0.312 0.241 0.179 0.126 0.084 0.051 1.000 0.996 0.988 0.973 0.949 0.916 0.874 0.821 0.759 0.688 0.609 0.525 0.437 0.348 0.262 1.000 1.000 0.999 0.998 0.996 0.992 0.985 0.974 0.959 0.938 0.908 0.870 0.821 0.760 0.684 1.000 1.000 1000 1000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000Explanation / Answer
We have given n=4
then use direct cammand as
>pbinom(x,n.p) # x=observation , n=4 ,p=probability
Now , n=4 Assume x=2 and p=0.55 then
>pbinom(2,4,0.55)
[1] 0.6090187
and which same as in binomial table. but in binomial table value is approximatated and which is 0.609.