BookmarkSubscribeRSS Feed
madelinehenry
Calcite | Level 5
Hello, 
I am a student and new to SAS. Working on an assignment asking me to perform a grid-based clustering analysis. Is there such a procedure in SAS using SAS Studio? I am looking for resources to guide me. 
 
The output I'm needing for the assignment is a scatterplot of two-dimensional data over a grid (49 cells) and a table of point counts by grid. I've attempted to summarize my data below with first 5 lines as directed, by - this is my first time posting, so please let me know if there is more detail I should provide. 
 
Thank you for any direction you can provide!
 
 
data WORK.IMPORT;
infile datalines dsd truncover;
input x:BEST12. y:BEST12.;
format x BEST12. y BEST12.;
datalines;
1.242014903 4.720908725
0.930117097 3.543344014
2.635858688 3.248436634
0.657832858 4.382112956
3.273950718 4.17188644
;;;;
3 REPLIES 3
Ksharp
Super User
I am not sure. Check PROC CLUSTER + CCC option
Ksharp
Super User

I remember @Rick_SAS  plot such kind of graph in his blog . 

https://blogs.sas.com/content/iml

Rick_SAS
SAS Super FREQ

The terms to search for are "binning" or "2-d binning". In particular, it sounds like you want equal-width binning.

 

Your instructor might have mentioned ways to bin the data. There are many ways to do this. Including the DATA step, PROC IML, PROC KDE, PROC FORMAT+PROC FREQ, and more. Your instructor might have given a hint about which method you should use, so check with him or her.

 

More information that you will need is discussed in The Essential Guide to Binning in SAS.

 

If your instructor did not indicate a preference for this assignment, PROC FORMAT and PROC FREQ might be the easiest combination. If you have never used PROC FORMAT, then maybe use PROC KDE and the OUT= option on the BIVAR statement. For PROC KDE, the first step would be something like this example (which uses example data)

proc kde data=sashelp.bweight;
   bivar MomWtGain(ngrid=7) Weight(ngrid=7) / out=kdeout;
run;

I will leave the rest of the assignment to you. Good luck.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 1173 views
  • 3 likes
  • 3 in conversation