LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (January 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 8 Jan 2007 11:31:26 -0500
Reply-To:   "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject:   Re: finding the (x,y) coordinates of the max/min of an ellipse
Comments:   To: sas-l@uga.edu

Michael Friendly wrote: > Hi all, > > I have a set of macros that draw what I call HE plots, showing the > variation due to hypothesis and due to error in a multivariate linear > model by ellipses. See my recent article in Journal of Statistical > Software, > http://www.jstatsoft.org/v17/i06/ > > I want to write a label for each ellipse at the (x,y) coordinate of > either the maximum or minimum value of y and the corresponding x > value. I can do this as shown below using proc summary, but this > solution is inconvenient in the macros because > (a) it requires an ID variable and > (b) requires an extra pass through the ellipses > data set. > > Perhaps there is a simpler (SQL ?) solution someone can > suggest?

Definitely a SQL worthy query.

---------- data ellipse; input id x y function $; mat = 1; output; mat = 2; output; datalines; 1 0.99993 0.01222 move 2 0.79459 1.18537 draw 3 0.28576 1.90575 draw 4 -0.33223 1.89820 draw 5 -0.82332 1.16560 draw 6 -0.99993 -0.01222 draw 7 -0.79459 -1.18537 draw 8 -0.28576 -1.90575 draw 9 0.33223 -1.89820 draw 10 0.82332 -1.16560 draw 11 0.99993 0.01222 draw ;

proc sql; create view bounds as select * , y=min(y) as isMinY , y=max(y) as isMaxY from ellipse group by mat having y=max(y) or y=min(y); ----------

Richard A. DeVenezia http://www.devenezia.com/


Back to: Top of message | Previous page | Main SAS-L page