On Wed, 7 Mar 2012 10:28:24 -0500, vivian v <v.vivian3@GMAIL.COM> wrote:
>I have a data like the following:
>Suppose I have 4 groups. How can I draw 4 density plots for each group
>overlay on one figure? Thanks!
You can use PROC UNIVARIATE to draw comparative histogram where each
density is in its own panel.
To overlay them in a single plot:
1) Reshape the data so that each group becomes a variable, using the
technique described in http://blogs.sas.com/content/iml/2011/11/04/reshape-
2) Use SGPLOT to overlay the densities, using the technique shown in
If you also want histograms, see
Statistical programming and SAS/IML blog: http://blogs.sas.com/content/iml