Re: [R] Binomial simulation

2009-04-19 Thread beetle2
Hi All, Thank you for all your help. In future I will state if it's homework related. regards Brendan beetle2 wrote: > > Hi Guy's > I was wondering if someone could point me in the right direction. > > dbinom(10,1,0.25) > > I am using dbinom(10,1,0.25) to calculate the probabilty of 10

Re: [R] Binomial simulation

2009-04-19 Thread Johannes Huesing
beetle2 [Sun, Apr 19, 2009 at 03:01:43AM CEST]: > > I'm thinking I will just use: > results <- rbinom(1000, 10, .25) > d = sum(results == 0 ) > df = (d/1000) > df > > And do each individually ok, at least you are trying some things out for yourself. In fact, along with reading the doc, this is

Re: [R] Binomial simulation

2009-04-19 Thread Ranjan Maitra
With due respect, and in all fairness, you should inform your instructor that you took help from R's mailing list for doing homework. This mailing list (or any other general mailing list for that matter) is not for doing your (or anyone else's) homework. If the instructor allowed that, that is a

Re: [R] Binomial simulation

2009-04-19 Thread beetle2
I've done some study. And made a couple of loops to compare the dbinom() and rbinom() Here are the results: The instructor only asked for 1000 trials so its not that accurate. but its close to it. > for(x in c(1:10)) + {print(dbinom(x,10,.25)) } [1] 0.1877117 [1] 0.2815676 [1] 0.2502823 [1] 0.1

Re: [R] Binomial simulation

2009-04-19 Thread beetle2
I'm thinking I will just use: results <- rbinom(1000, 10, .25) d = sum(results == 0 ) df = (d/1000) df And do each individually beetle2 wrote: > > Hi Guy's > I was wondering if someone could point me in the right direction. > > dbinom(10,1,0.25) > > I am using dbinom(10,1,0.25) to calcula

Re: [R] Binomial simulation

2009-04-19 Thread beetle2
Sorry guys one quick question I've graphed the histogram with hist(rbinom(n = 1000, size = 10, prob = 0.25)) How to I sum the individual values 0 to 12? regards Brendan beetle2 wrote: > > Hi Guy's > I was wondering if someone could point me in the right direction. > > dbinom(10,1,0.25) > > I

Re: [R] Binomial simulation

2009-04-19 Thread beetle2
Thank you for your help! Yes you are right the probabilities are for the values 0 through 12. I been asked to compare the simulated values to that of dbinom() once again thanks! Ranjan Maitra wrote: > > This sounds like a potential homework problem. You don't quite need to > simulate anythin

Re: [R] Binomial simulation

2009-04-18 Thread Ranjan Maitra
This sounds like a potential homework problem. You don't quite need to simulate anything if your question is all you have been asked to do. dbinom(x = 1:10, size = 10, prob = 0.25) Perhaps you have been asked to simulate 1000 realizations and compare the relative frequencies with these probabilit

Re: [R] Binomial simulation

2009-04-18 Thread beetle2
Not being entirely sure what you mean, I think rbinom(1000, 10, .25) may be what you want. Hi, Thanks for your reply. It is close to that but I need to know the probabilty of how many judges pick a certain brand. Just say x= 6 judges pick brand A which has P=0.25. Using R it would be: > db

Re: [R] Binomial simulation

2009-04-17 Thread Johannes Huesing
beetle2 [Fri, Apr 17, 2009 at 11:28:56PM CEST]: > > Hi Guy's > I was wondering if someone could point me in the right direction. > > dbinom(10,1,0.25) > > I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges > choosing a certain brand x times. dbinom returns the discrete dens

[R] Binomial simulation

2009-04-17 Thread beetle2
Hi Guy's I was wondering if someone could point me in the right direction. dbinom(10,1,0.25) I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges choosing a certain brand x times. I was wondering how I would go about simulating 1000 trials of each x value ? regards Brendan -