Repeat the re-sampling function for 1000 times ? Using lapply?

后端 未结 1 1340
陌清茗
陌清茗 2021-01-11 16:53

Please me out! I appreciate any helps ! Thanks!

I have trouble on repeat doing re-sampling for 1000 times. I tried using replicate() to do that but it\'s not working

相关标签:
1条回答
  • 2021-01-11 17:54

    This is more of an extended comment where I demonstrate that replicate should work. Here's an example of a CLT. Just replace your lines what's between the curly braces.

    x <- replicate(1000, {
      mm <- runif(10)
      mean(mm)
      })
    hist(x)
    

    enter image description here

    0 讨论(0)
提交回复
热议问题