I have 500 observations, each of which has two measurements [offmm_ind and delta].
The dataset is attached below.
How to generate 2D histogram/heatmap?! Thanks,
https://www.google.com/search?q=sas+heatmap
Google search :
You can add the term "density" in the Google search if you wish.
See also :
Graphics Samples Output Gallery
https://support.sas.com/en/knowledge-base/graph-samples-gallery.html
Cheers,
Koen
There are two ways to deal with data like this:
1) Create a scatter plot and use semi-transparent markers to show regions where many observations are overplotted
2) Use a heat map to bin the markers onto a 2-D grid, then display the frequency of observations in each cell/bin.
You asked for (2), so here it is:
libname myLib "C:\Users\frwick\Downloads";
title "Frequency of Observations in 2-D Bins";
proc sgplot data=MyLib.Have;
heatmap x=offmm_ind y=delta;
run;
Rick_SAS_0-1788960246334.png
For more ways to visualize the density of bivariate data, see
https://blogs.sas.com/content/iml/2019/09/18/visualize-density-bivariate-data.html
For frequency-based heat maps, you might want to favor two-color ramps instead of three-color ramps. Using @Rick_SAS 's program with the COLORMODEL option:
title "Frequency of Observations in 2-D Bins";
proc sgplot data=MyLib.Have;
heatmap x=offmm_ind y=delta / colormodel=twocolorramp;
run;
SGPlot.png
CFC_SAS_Communities_400x225.jpg
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.