- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I've been learning about SAS in a course and I've been looking for ways to apply it to my job in analytical chemistry. Is it possible to use SAS to produce heat maps? It looks like SAS will be much more direct in figure customization compared to MPP. If I have data that looks like this:
Sample_1 | Sample_2 | Sample_3 | Sample_4 | Sample_5 | Sample_6 | ||
Control | Control | Control | Treatment_A | Treatment_A | Treatment_A | ||
Compound_1 | Pathway_1 | 0.31 | 0.98 | 0.02 | 0.96 | 0.81 | 0.59 |
Compound_2 | Pathway_1 | 0.85 | 0.21 | 0.91 | 0.41 | 0.01 | 0.86 |
Compound_3 | Pathway_1 | 0.58 | 0.98 | 0.15 | 0.46 | 0.02 | 0.62 |
Compound_4 | Pathway_1 | 0.04 | 0.59 | 0.22 | 0.17 | 0.03 | 0.86 |
Compound_5 | Pathway_1 | 0.40 | 0.89 | 0.44 | 0.84 | 0.35 | 0.21 |
Compound_6 | Pathway_1 | 0.46 | 0.13 | 0.34 | 0.97 | 0.29 | 0.21 |
Compound_7 | Pathway_2 | 0.82 | 0.42 | 0.71 | 0.29 | 0.82 | 0.92 |
Compound_8 | Pathway_2 | 0.53 | 0.78 | 0.16 | 0.25 | 0.06 | 0.56 |
Compound_9 | Pathway_2 | 0.67 | 0.60 | 0.94 | 0.15 | 0.40 | 0.53 |
Compound_10 | Pathway_2 | 0.40 | 0.42 | 0.89 | 0.61 | 0.94 | 0.63 |
Compound_11 | Pathway_2 | 0.48 | 0.86 | 0.11 | 0.69 | 0.44 | 0.09 |
Compound_12 | Pathway_2 | 0.29 | 0.64 | 0.63 | 0.59 | 0.87 | 0.48 |
I can format the data however I'd like in Excell before I bring it into SAS if it makes it easier. Right now some of the lab members are running ANOVAs by cutting and pasting code into Graphpad so I've already got some ideas for using SAS to streamline things but I was wondering if it was possible to take it a step further.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you see that SAS has a dedicated heatmap statement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For most things in SAS you would be better off having a separate variable such as Sample_number, and another variable that indicates Control and Treatment_a and assuming the body of the numbers are measuring the same property then one variable for the measurement.
Heatmaps use 2 variables for the dimensions. From your example I am not sure what makes most sense for the dimensions as each segment needs one value from each dimension for location and optionally a value to assign a weight or frequency for setting the color of the blocks.
Here is a not terribly useful but simple example using a data set you should have available.
proc sgplot data=sashelp.class; heatmap x=height y=weight / nxbins=4 nybins=3 showxbins showybins freq=age ; run;
The above code uses the given data set with the student height as the xaxis, student weight as yaxis,
nxbins and nybins set maximum number of bins to group the values of height and weight and the Showxbins and Showybins will have axis tick marks at the (may be approximate) center of the bin. the Freq=Age treats each record as between 11 and 16 records just to use the feature. Remove that bit and see the difference of appearance. There will be gradient on the right of the graph indicating the value the colors of the bins in heatmap indicate.