BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Junyong
Pyrite | Level 9

The following HAVE contains X and Y, which are normally distributed.

data have;
do i=1 to 5000;
x=rannor(1);
y=rannor(1);
output;
end;
run;

KDE estimates the kernel densities.

ods listing gpath="!userprofile\desktop\";
ods graphics on;
proc kde;
univar x(bwm=0.05) y(bwm=0.05)/plots=(density densityoverlay);
run;
ods graphics off;

The code spits out the following three plots—(1) the kernel density of X, (2) that of Y, and (3) the overlapped one.

1.png2.png3.png

The problem is the third one, which poorly overlaps the first two. Though it works well without the BWMs above, I practically need to use them. What is the problem here? Thanks a lot.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Your bandwidth multiplier is causing the issue. Make it bigger or use bandwidth (BW) setting alone instead of the multiplier version, unless you understand what it's doing and that's what you want.

View solution in original post

2 REPLIES 2
Reeza
Super User
Your bandwidth multiplier is causing the issue. Make it bigger or use bandwidth (BW) setting alone instead of the multiplier version, unless you understand what it's doing and that's what you want.
Junyong
Pyrite | Level 9
I misunderstood the function of BW and BWM so far. Thanks for the notice.

SAS Innovate 2025: Register Now

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 585 views
  • 4 likes
  • 2 in conversation