title: R: min, max, mean and median of a vector within 95% confidence interval (2.5 to 97.5 percentiles)
body: <p>I ran 1000 iterations to generate a normal deviate using <code>rnorm</code> and saved it in a vector: </p>
  
  <p><code>rvec &lt;- rnorm (1000, mean = 0.143927671, sd = 0.110680809)</code></p>
  
  <p>I need to find a min, max, mean and median of a vector within 95% confidence interval (2.5 to 97.5 percentiles), are there any functions to do that in R?
  I was trying to use <code>apply</code>, but it doesn't seem to give what I want:</p>
  
  <pre><code>rmax = apply(rvec, 2, max, c(.025, 0.975))
  </code></pre>
  
  <p>So I want to estimate min/max/mean/median of a population based on a random sample / subset of that population</p>
  
  <p>In Excel there is an AddIn for MonteCarloanalysis, but I want to do that in R.</p>
  
  <p>Thank you!</p>