title: Simulating rbinom 100,000 times and finding proportions
body: <p>So I want to simulate 200 observations of binary random numbers whose value is 1 with a 60% probability and 0 with a 40% probability, and calculate the proportion of 1s. Repeat the simulation 100,000 times and find out how many times the proportion is smaller than 0.55</p>
  <p>So far I know I need to have <code>rbinom(200,1,.6)</code> and probably a for loop somewhere</p>
  <p>What I've been able to write is this</p>
  <pre><code>x=numeric(100000)
  for(i in 1:100000){
  x[i]=rbinom(200,1,.6)}
  </code></pre>
  <p>But everytime I do it just doesn't work. Also, how could I know how many times the proportion is smaller than .55?</p>