Re:Statistics for Hackers [video]
by babo on Thursday June 16, 2016 @09:05AM
(#11915798)
Is that code answers your question? No offense but the main message of that talk is if you can do a for loop than you can do statistics simulation in any programming environment. Like in R.
m <- 0
nexp <- 100000
for (i in 1:nexp) {
if (sum(rnorm(30, mean=0, sd=1) < 0) >= 22) {
m <- m + 1
}
}
m <- 0 nexp <- 100000
for (i in 1:nexp) { if (sum(rnorm(30, mean=0, sd=1) < 0) >= 22) { m <- m + 1 } }
print(m / nexp)