Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206503

Approximating a statistical calculation

$
0
0

First, what on earth is going on inside this code block?

run7=c()
 for (i in 1:1e4) {
   run1 = sum(runif(14) > 0.7)
   run7 = c(run7, run1 < 4)
 }
 run9 = sum(run7) / length(run7)

Second, how do I calculate the exact value of run9 in a single R function?


Viewing all articles
Browse latest Browse all 206503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>