I want to calculate the cumulative bivariate normal distribution of two standard normal variables. Is there a SAS PROC or SAS FUNCTION that does this? When rho=0, this is easy but rho =^ 0, it's more involved. For example, suppose x1=-2.05 and x2=-1.64. -2.05 is associated 0.02 with and -1.64 is associated with 0.05. When rho=0, you just multiply 0.02*0.05 to get 0.001 but when rho N=^ 0 it's a little messy. Trying to avoid writing the code if SAS has a PROC of FUNCTION that does this for me. No IML please.
Yes, use the PROBBNRM function, which is in Base SAS. I describe the function and how to use it in the article "Visualize the bivariate normal cumulative distribution."
data CDF2D;
input rho x1 x2;
cdf = probbnrm(x1,x2,rho);
datalines;
0 -2.05 -1.64
0.5 -2.05 -1.64
-0.5 -2.05 -1.64
;
proc print data=CDF2D; run;
No IML? Trying to avoid writing the code? There is the PROBBNRM function in SAS, but that's not a cumulative distribution. And from that point on, I think you either need to write your own code, or use IML.
Update: this answer is incorrect; see comment from @FreelanceReinh below
@PaigeMiller wrote:
There is the PROBBNRM function in SAS, but that's not a cumulative distribution.
Hi @PaigeMiller, I think it is cumulative and hence ideal for PaulN's task.
(Thanks to Rick_SAS for mentioning the function recently enough so that I remembered it.)
@FreelanceReinh thanks for the correction!!!
Better calling @Rick_SAS
Yes, use the PROBBNRM function, which is in Base SAS. I describe the function and how to use it in the article "Visualize the bivariate normal cumulative distribution."
data CDF2D;
input rho x1 x2;
cdf = probbnrm(x1,x2,rho);
datalines;
0 -2.05 -1.64
0.5 -2.05 -1.64
-0.5 -2.05 -1.64
;
proc print data=CDF2D; run;
Thank you for the help. It's appreciated.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.