LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Oct 2007 15:28:25 -0500
Reply-To:     Mary <>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mary <mlhoward@AVALON.NET>
Subject:      Re: Assignment using min and max
Comments: To: "C.A.N." <healthysheep@YAHOO.COM>
Content-Type: text/plain; charset="iso-8859-1"

My SAS is running at the moment, so this is not tested, but couldn't you do this with macro variables?

proc sql; select min(variable) into :min_macro_var from seta;

proc sql; select max(variable) into max_macro_var from seta;

proc sql; create table newb as select * from setb where variable >= &min_macro_var and variable <= &max_macro_var;

-Mary ----- Original Message ----- From: C.A.N. To: SAS-L@LISTSERV.UGA.EDU Sent: Wednesday, October 17, 2007 3:09 PM Subject: Re: Assignment using min and max

On Oct 17, 9:56 am, (Peter Flom) wrote: > "C.A.N." <healthysh...@YAHOO.COM> wrote > > > > >Is there a way, other than hard coding the ranges, to assign > >observations from a data set into groups/clusters based on the min-max > >output from proc means (based on another data set)? > > >Thanks. > > I am not quite sure what you mean, here. Tell me if I have the idea > > You have two data sets. Each has the same variables, but different observations. You want to find out which observations, in data set B, have the minimum or maximum from data set A, and assign them to groups based on that.... > > Are these variables continuous or ordinal? > If continuous, then the max from one data set is unlikely to exactly match the max from the other data set. Or do you want to assign them to a group if they are "close" to the max or min from the other data set? > > If you have more than one variable, how do you deal with that? > > I'm obviously not fully understanding what you intend - could you explain further? > > Thanks > > Peter

With data set A, I defined/clustered x groups based on one continuous variable. The clusters have minimum and maximum values for that variable. I would look to apply those minimum and maximum values to assign the observations of another data set with the same varibles variables to the same groups.

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