title: PROC MEANS step in SAS: how to create variable out of mean and standard deviation?
body: <p>I'm running a simulation and need to link up the mean and standard deviation of two variables (e_2 and e_3) with the original dataset. This is my code thus far:</p>
  
  <pre><code>proc means data=unif;
      var e_2 e_3;
      output out=means (drop = _TYPE_ _FREQ_);
  run;
  </code></pre>
  
  <p>Which gives a dataset named "means" like:</p>
  
  <pre><code>    _STAT_    e_2    e_3
  1     N      50000  50000
  2    MIN      0.2    0.4
  3    MAX      0.8    0.9
  4    MEAN     0.5    0.6
  5    STD      0.1    0.2
  </code></pre>
  
  <p>From this "means" dataset, I need the mean and standard deviation of variables e_2 and e_3 to become variables of their own (4 variables total), so it ends of looking like this:</p>
  
  <pre><code>     mean_e_2    mean_e_3    sd_e_2   sd_e_3
  1      0.5         0.6         0.1      0.2
  </code></pre>
  
  <p>I'm just looking to link up the means and standard deviations of e_2 and e_3 with my original dataset.</p>