These days customers are more demanding when it comes to graphs, and want to obtain a lot of information fast from a single graph. There’s been a lot of interest on overlaying a Boxplot on top of a Scatter Plot, and there was no easy way to do that with the Scatter and Vbox Statements in Proc SGPLOT, let along producing a jittered scatter plot. The boxplot is produced by cleverly using the Vector statement in SGPLOT. Hope the code helps!
|Adding jitter to the plots in SAS isn’t going to be made easily until SAS 9.3 comes out, so above is some SAS Code that will demonstrate how you can add jitter to your plots.|
A ROC (Receiver Operator Characteristic) curve shows how well two groups are separated by plotting the Sensitivity by 1 – Specificity. When used alone, the cut off used to balance the desired Sensitivity and Specificity is not shown. Furthermore the ROC curve does not display the interesting counts and percentages of the True Positives, True Negatives, False Positives, and False Negatives.
The macro presented in this paper uses Graph Template Language (GTL) and the Statistical Graphics Engine (SGE) to quickly and easily create an informative graph that can be edited and which displays the Sensitivity and Specificity of your binary classifier. The macro also displays scatter and box plots of the desired variable by the binary classifiers to identify unusual results. Options also display a confusion matrix and area under the curve (AUC) results. The confusion matrix is calculated from the default Sensitivity and Specificity intersection, but the cut off can be made explicitly. The AUC statistic shows how well the binary classifier discriminates. This macro is used with SAS® 9.2 Phase 2.
The following SAS 9.2 tip plots the foldchange and (95%) confidence intervals, and displays the foldchange on the graph.
The following SAS tip plots power curve’s and cross references the sample size per group required to achieve the power.
The following SAS tip formats the rows outputted to Excel in three different colors depending on the results of the p-values
The Powerpoint Presenation below and the SAS Code will explain and generate correlated random variables for you. It’s very useful when you have to produce correlated graphs!
When it comes to Venn Diagrams most people use a combination of Microsoft PowerPoint to generate two or three way Venn diagrams, and use filtering in Excel to count the numbers in each group. Not many people know about the four way Venn diagram and when it comes to counting the numbers in each of the 16 groups and inputting the figures into the right group it is usually done nervously and is very time consuming.
There are some websites that enable you to create 2, 3, and 4 way Venn Diagrams quite easily, however they only work with qualitative data, assume that all the elements are within the union of the groups, and do not offer you the ability to drill down in to each of the 16 groups to see the elements that are making up the groups.
This paper shows how you can combine SAS Macro, logical data steps, DSGI, and HTML to generate 2, 3 and 4 Way Venn Diagrams with Drill Down Functionality very quickly. This algorithm is very useful when looking at results of transcriptomic experiments because of the huge volume of data.
It is now possible to call R from SAS using SAS/IML Studio v 3.2. The only benefits of using this is when there is a need to use R and SAS obviously. For example manipulating the data in SAS and then analysing the data with Random Forest, CART or other new Statistical methods that have been implemented in R but yet to be implemented in SAS!
It’s funny how some people still say that they use SAS for the manipulation and R for the plots when SAS 9.2 (Proc SGPLOT, SGPANEL, SCATTER and RENDER) offers good quality plots, and R has functions that can manipulate datasets eg sql.df.
Anyway watch this space for a good example of how the R integration with SAS works superbly!