UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS FAQ
How can I graph two (or more) groups using different symbols?

Suppose we are using the High School and Beyond data file (hsb2) which has test score for 200 students, 91 males and 109 females.  We could make a graph of their read and write scores as shown below with proc gplot.

proc gplot data = hsb2;
  plot read*write;
run;
quit;

Now, let's make a graph where we see the scores separately for the males and the females. This can be done by using variable female as the third variable in the plot statement, and optionally using more symbol statements.

goptions reset = all;
symbol1 v=star c=red h=1;
symbol2 v=triangle c=blue h=1;
proc gplot data = hsb2;
  plot read*write=female;
run;
quit;

[http://www.ats.ucla.edu/stat/sas/footer.htm]