title: Finding p value of histogram data in R
body: <p>Based on the proportion of slopes from the randomisation, greater or less than the slope from the observed data, I would like to calculate the expected probability of getting the observed slope. The observed slope is -0.2717.</p>
  
  <p>Any help would be greatly appreciated, I am a newbie.</p>
  
  <pre><code>histdata&lt;- numeric(10000)
  for (i in 1:10000) {histdata[i]&lt;-(summary.lm(lm(sample(tcons)~tleave))
  [[4]][[2]])}
  hist(histdata)
  abline(v=-0.2717, lwd=3, lty=2)
  box()
  
  data3&lt;- -0.2717&gt;histdata
  </code></pre>
  
  <p>This ^^ gives me 9954 that are not greater than the original and 46 that are greater.</p>