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 (September 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 5 Sep 2004 15:47:42 -0400
Reply-To:     Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:      Re: division of 2 tabs by each other

Do you have SAS/IML (Interactive Matrix Language) licensed? It provides the most straightforward solution. Quoting from the manual: "The division operator (/) divides each element of matrix1 by the corresponding element of matrix2, producing a matrix of quotients."

The same thing can be accomplished using either a DATA step or PROC SQL, but it may be awkward. That depends largely on how many variables there are and how they are named. Are the variable names in A and B the same? Are the names formed with a common stem and numeric suffixes, like VAR1, VAR2, ... VARp?

Depending on what you have to do after calculating the ratios, you may want to start by reshaping your datasets so that each has n x p observations and three variables (N_KEY, P_KEY, and VALUE). That would make computing the ratios a snap in either a DATA step or PROC SQL.

On Fri, 3 Sep 2004 13:27:22 -0700, Bazyllll <bazyllll@HOTMAIL.COM> wrote:

>Hi I 'd like to create a tab where each value is the ratio of 2 other >tab. > >I have one first tab for n individuals for p variables under the >condition A >I have one second tab for n individuals(same as A) for p >variables(same as A) under the condition B > >I'd like to create a new tab where for each individuals and each >variables the value is A/B > >I know it's easy under excel but I want to do it under sas cause >otherwise I have to correct many values. > >I'm not so familiar with sas, but it seems it' not as simple as using >a "If then" command. > >Thanks in advance, >Bazyllll


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