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 open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.