data corr_vars; input x1 var1 x2 var2; *var1 and var2 are the variances for x1 and x2; a_x1 = ((1 - x1) / var1 - 1/ x1) * x1**2; a_x2 = ((1 - x2) / var2 - 1/ x2) * x2**2; b_x1 = a_x1 * (1 / x1 - 1); b_x2 = a_x2 * (1 / x2 - 1); datalines; 0.896 0.001 0.207 0.004 ; proc print data = corr_vars; run; Therefore: alpha1 = 82.597 beta1 = 9.587 alpha2 = 8.289 beta2 = 31.750 Then, here is the code I used to generate the correlated rates based on the book chapter: proc iml; call randseed(12345); N = 10000; *number of random variable sets to generate; Z = RandNormal(N, {0, 0}, {1 0.5, 0.5 1}); *RandNormal(N, Mean, Cov); U = cdf("Normal", Z); x1_beta = quantile('BETA', U[,1], 82.597, 9.587); x2_beta = quantile('BETA', U[,2], 8.289, 31.750); X = x1_beta || x2_beta; *here are my correlated variables, beta-distributed; rhoZ = corr(Z)[1,2]; *check correlations; rhoX = corr(X)[1,2]; print X; print rhoZ rhoX;
... View more