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 (July 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 3 Jul 2009 10:23:32 -0400
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: a very simple question: base
Comments:   To: lautko@GMAIL.COM

If the problem is as simple as you describe, you may be able to solve it with something like:

data have; input year variable1; cards; 2007 10 2009 5 2009 3 ;

data want (drop=base); set have; retain base; if year eq 2007 then do; base=variable1; end; ratio=variable1/base; run;

HTH, Art --------- On Fri, 3 Jul 2009 00:57:32 -0700, skyline <lautko@GMAIL.COM> wrote:

>Hello, >A very simple question: > >suppose I have a dataset test such as > >year month variable1 >2008 1 10 >2008 2 5 >2009 1 5 >2009 2 3 > >then I run > >proce means data=test2; >var variable1; >by year; >output out=test2 mean=variable2; >run; >to get (roughly) > >year variable2 >2008 7.5 >2009 4 > >from the previous post, I now know how to get > >year variable1 >2007 10 >2009 5 >2009 3 > >now I would like to get to use the 2007 value as a base so that > >year variable1 ratio >2007 10 1 >2008 5 0.5 >2009 3 0.3 > >Please advise.


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