Re: [R] simulation in R

2016-04-22 Thread David L Carlson
y College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kristi Glover Sent: Wednesday, April 20, 2016 1:06 AM To: R-help Subject: [R] simulation in R I realized that there was a typo error. I mean "Monte Ca

Re: [R] Simulation in R

2013-08-04 Thread Prof Brian Ripley
On 04/08/2013 09:30, Rui Barradas wrote: Hello, See the help page for ?sample. X <- sample(0:1, 1, replace = TRUE, prob = c(0.25, 0.75)) Hope this helps, ?rbinom would have been a better answer since simpler, faster, algorithms are available in that case. Or even as.integer(runif(100

Re: [R] Simulation in R

2013-08-04 Thread Preetam Pal
Thank you very much guys On Sun, Aug 4, 2013 at 3:51 PM, Prof Brian Ripley wrote: > On 04/08/2013 09:30, Rui Barradas wrote: > >> Hello, >> >> See the help page for ?sample. >> >> X <- sample(0:1, 1, replace = TRUE, prob = c(0.25, 0.75)) >> >> Hope this helps, >> > > ?rbinom would have been

Re: [R] Simulation in R

2013-08-04 Thread Jeff Newmiller
So you looked at some unspecified help pages online and tried some unspecified stuff? Try being more specific next time you post. For example, try reading the footer of any R-help email. Note that it says read the Posting Guide, and provide a reproducible example (at least of what you tried that

Re: [R] Simulation in R

2013-08-04 Thread Rui Barradas
Hello, See the help page for ?sample. X <- sample(0:1, 1, replace = TRUE, prob = c(0.25, 0.75)) Hope this helps, Rui Barradas Em 04-08-2013 08:51, Preetam Pal escreveu: Hi All, I want to simulate a random variable X which takes values 1 and 0 with probabilities 75% and 25% respectively

[R] Simulation in R

2013-08-04 Thread Preetam Pal
Hi All, I want to simulate a random variable X which takes values 1 and 0 with probabilities 75% and 25% respectively and then repeat the procedure 1 times. I am sure this is trivial, I tried to look at the help pages online, but I can't quite find it. Appreciate your help. Thanks and Reg

Re: [R] Simulation in R

2012-12-01 Thread Greg Snow
look at functions replicate and mvrnorm functions (the later in the MASS package). On Sat, Dec 1, 2012 at 12:02 PM, mboricgs wrote: > Hello! > > How can I do 100 simulations of length 17 from bivariate bivariate normal > distribution, if I know all 5 parameters? > > > > -- > View this message

[R] Simulation in R

2012-12-01 Thread mboricgs
Hello! How can I do 100 simulations of length 17 from bivariate bivariate normal distribution, if I know all 5 parameters? -- View this message in context: http://r.789695.n4.nabble.com/Simulation-in-R-tp4651578.html Sent from the R help mailing list archive at Nabble.com. __