title: Generate correlated random variables that follow beta distributions
body: <p>I need to generate random values for two <a href="https://en.wikipedia.org/wiki/Beta_distribution" rel="noreferrer">beta-distributed</a> variables that are <em>correlated</em> using SAS. The two variables of interest are characterized as follows:</p>
  
  <hr>
  
  <p><code>X1</code> has <code>mean = 0.896</code> and <code>variance = 0.001</code>.</p>
  
  <p><code>X2</code> has <code>mean = 0.206</code> and <code>variance = 0.004</code>.</p>
  
  <p>For <code>X1</code> and <code>X2</code>, <em>p</em> = 0.5, where <em>p</em> is the correlation coefficient.</p>
  
  <hr>
  
  <p>Using SAS, I understand how to generate a random number specifying a beta distribution using the function <code>X = RAND('BETA', a, b)</code>, where <em>a</em> and <em>b</em> are the two shape parameters for a variable <em>X</em> that can be calculated from the mean and variance. However, I want to generate values for both <code>X1</code> and <code>X2</code> simultaneously while specifying that they are correlated at <em>p</em> = 0.5.</p>