|
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.
|