03-22-2015 09:22 PM
/** Our analysts used to use ECO / Proc Insight to display a graph to detect outliers (comparing previous and current data values). Once the graph was visible, the user would click on outliers and the ID for the point(s) would display and remain displayed. The user would take a screen shot and follow up on the outliers.
We are switching from ECO to EG and this code plots a graph with hover over functionality. But once the user moves the cursor off the outlier point, the info disappears. Ideally it would be more efficient if the user could hover over a point or click on it, and the ID would be written to a file / dataset to reduce transcription error.
Ideas / suggestions welcome
AltText = ' alt=' || quote('Name: ' || put(Name, $10.) );
axis1 label = ('height');
axis2 label = ('weight');
title "Study of Height vs Weight";
footnote1 j=l "Source: T. Lewis & L. R. Taylor";
footnote2 j=l "Introduction to Experimental Ecology";
proc gplot data=myClass;
plot height*weight /vaxis=axis2 haxis=axis1 html=AltText ;
footnote1; /* this clears footnote1 and footnote2 */
plot height*weight / haxis=45 to 155 by 10
vaxis=48 to 78 by 6
05-27-2015 07:00 PM
I have found something that mostly gets the job done in https://communities.sas.com/message/108580#108580
The code as below
data foo; set sashelp.class;
if height>=67 then outlier_text=trim(left(height));
symbol1 value=dot interpol=none pointlabel=("#outlier_text");
proc gplot data=foo;
has been used as a basis for a macro that can be called by different users, to determine outliers. The user can supply a rule, will see two graphs (one with all points, one with 'rule-breakers' labelled), and will get a dataset and/or xlsx with the outliers for further processing.