<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic multiplying two datasets by one anther in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/403576#M278942</link>
    <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I have a problem that probebly requires matrices. To simplify the problem I'll say I want to divide dataset A by dataset B. Dataset A contains demographic data of a population and has the following structre:&lt;BR /&gt;&lt;BR /&gt;Dataset A&lt;BR /&gt;Country Year Age-group Sex&amp;nbsp;&amp;nbsp;&amp;nbsp; population.size&lt;BR /&gt;USA&amp;nbsp;&amp;nbsp; &amp;nbsp;1995&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp; &amp;nbsp;10,000&lt;BR /&gt;USA &amp;nbsp;&amp;nbsp; 1995&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp;&amp;nbsp; 20,000&lt;BR /&gt;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dataset B contains the number of disease cases by each country, year, age group and sex.&lt;/P&gt;&lt;P&gt;Dataset B&lt;BR /&gt;Country Year Age-group Sex Nr.cases&lt;BR /&gt;USA&amp;nbsp;&amp;nbsp; &amp;nbsp;1995&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;USA &amp;nbsp;&amp;nbsp; 1995&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;male &amp;nbsp;&amp;nbsp; 400&lt;BR /&gt;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&lt;BR /&gt;&lt;BR /&gt;and what I would like to calculate is the disease incidence, i.e. the number of case in that population in that year. For age group 1 it will be 500/10000=0.2.&lt;BR /&gt;&lt;BR /&gt;Now this is all simple and can be done by merging the two datasets, but what I have is way bigger, which is what making everything complicated. I have many countries, 6 years, almost 25 age-groups, two sexes, number of cases, deaths and most importantly several diseases. This means I have different population sizes for each country by each year as well.&lt;BR /&gt;&lt;BR /&gt;What I am thinking about is having each table saved a matrix, and then grouping similar matrices as an array. I can run the arthmetic operations then on a number of matrices.&lt;BR /&gt;&lt;BR /&gt;However I have no experince in matrics. I do not know if they exist in SAS, and I'm not sure if this is the best way to do this analysis. What do you think? How would you do it?&lt;BR /&gt;&lt;BR /&gt;thanks in forward&lt;BR /&gt;&lt;BR /&gt;Ubai&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 14:55:38 GMT</pubDate>
    <dc:creator>Ubai</dc:creator>
    <dc:date>2017-10-12T14:55:38Z</dc:date>
    <item>
      <title>multiplying two datasets by one anther</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/403576#M278942</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I have a problem that probebly requires matrices. To simplify the problem I'll say I want to divide dataset A by dataset B. Dataset A contains demographic data of a population and has the following structre:&lt;BR /&gt;&lt;BR /&gt;Dataset A&lt;BR /&gt;Country Year Age-group Sex&amp;nbsp;&amp;nbsp;&amp;nbsp; population.size&lt;BR /&gt;USA&amp;nbsp;&amp;nbsp; &amp;nbsp;1995&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp; &amp;nbsp;10,000&lt;BR /&gt;USA &amp;nbsp;&amp;nbsp; 1995&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp;&amp;nbsp; 20,000&lt;BR /&gt;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dataset B contains the number of disease cases by each country, year, age group and sex.&lt;/P&gt;&lt;P&gt;Dataset B&lt;BR /&gt;Country Year Age-group Sex Nr.cases&lt;BR /&gt;USA&amp;nbsp;&amp;nbsp; &amp;nbsp;1995&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;male&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;USA &amp;nbsp;&amp;nbsp; 1995&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;male &amp;nbsp;&amp;nbsp; 400&lt;BR /&gt;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&amp;nbsp;&amp;nbsp; &amp;nbsp;..&lt;BR /&gt;&lt;BR /&gt;and what I would like to calculate is the disease incidence, i.e. the number of case in that population in that year. For age group 1 it will be 500/10000=0.2.&lt;BR /&gt;&lt;BR /&gt;Now this is all simple and can be done by merging the two datasets, but what I have is way bigger, which is what making everything complicated. I have many countries, 6 years, almost 25 age-groups, two sexes, number of cases, deaths and most importantly several diseases. This means I have different population sizes for each country by each year as well.&lt;BR /&gt;&lt;BR /&gt;What I am thinking about is having each table saved a matrix, and then grouping similar matrices as an array. I can run the arthmetic operations then on a number of matrices.&lt;BR /&gt;&lt;BR /&gt;However I have no experince in matrics. I do not know if they exist in SAS, and I'm not sure if this is the best way to do this analysis. What do you think? How would you do it?&lt;BR /&gt;&lt;BR /&gt;thanks in forward&lt;BR /&gt;&lt;BR /&gt;Ubai&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 14:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/403576#M278942</guid>
      <dc:creator>Ubai</dc:creator>
      <dc:date>2017-10-12T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: multiplying two datasets by one anther</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/404155#M278943</link>
      <description>Why is using merge-technique to complicated to solve this task? Can post the real structure of your datasets?</description>
      <pubDate>Fri, 13 Oct 2017 21:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/404155#M278943</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-10-13T21:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: multiplying two datasets by one anther</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/404201#M278944</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122086"&gt;@Ubai&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Sounds to me like something which could be solved with a rather simple SQL - but I probably misunderstand something.&lt;/P&gt;
&lt;P&gt;What would really help: Provide sample data which illustrates the problem (working SAS data step code creating the sample data). Then show us how the desired result should look like.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 09:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/404201#M278944</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-14T09:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: multiplying two datasets by one anther</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/406361#M278945</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43025"&gt;@error_prone&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able indeed to solve it with PROC SQL as well as merging files. Thanks a lot for the hint.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2017 11:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiplying-two-datasets-by-one-anther/m-p/406361#M278945</guid>
      <dc:creator>Ubai</dc:creator>
      <dc:date>2017-10-22T11:42:05Z</dc:date>
    </item>
  </channel>
</rss>

