<?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 Re: how to use transpose to generate new tables and calculate relative risk with proc freq in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245282#M45753</link>
    <description>&lt;P&gt;Proc freq won't calculate relative risk with more than 2 groups. As indicated, I'm not sure your actually using the relative risk measure correctly, because you don't have a case/control situation. If you have an observational study you should be using odds ratio instead.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 20:20:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-21T20:20:03Z</dc:date>
    <item>
      <title>how to use transpose to generate new tables and calculate relative risk with proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245270#M45749</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input group $ subgp $ a b c;
datalines;
s amy 	71130	12739	11243
s brivy	14144	2548	2214
s vor	81841	6538	5820
s dce	68065	3775	3288
ase am 79199 20314 17987
bse bf 55981 5286 4578
g as2 703236 16685 14776
g bs5 6337 6747 5918
g co5 8607 2186 1881
;
data want;
set have;
d=a-c;
run;
proc transpose data=want out=notc prefix=group;
by group;
id subgp;
var d;
run;
proc print data=notc;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have several groups. Each group has two or over two outcomes. I want to use proc freq to calculate relative risk.&lt;/P&gt;&lt;P&gt;My orginal data has two variables listed above. I need to have a new variable, d, that is, d=a-c&lt;/P&gt;&lt;P&gt;then, i put d and c into the following code (b is not needed). I wonder whether there is a way, whether I can use transpose to make it more efficiently. and always, use first one of the subgroup (subgrp) as a reference, rr=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data question;&lt;BR /&gt;input subgrp $ Response $ Count;&lt;BR /&gt;datalines;&lt;BR /&gt;brivy Yes 2240&lt;BR /&gt;brivy No 11930&lt;/P&gt;&lt;P&gt;amy Yes 11243&lt;BR /&gt;amy No&amp;nbsp; 2214&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**************************&lt;/P&gt;&lt;P&gt;proc freq data=question order=data;&lt;BR /&gt;weight Count;&lt;BR /&gt;tables subgrp*Response / relrisk;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 19:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245270#M45749</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-21T19:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to use transpose to generate new tables and calculate relative risk with proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245282#M45753</link>
      <description>&lt;P&gt;Proc freq won't calculate relative risk with more than 2 groups. As indicated, I'm not sure your actually using the relative risk measure correctly, because you don't have a case/control situation. If you have an observational study you should be using odds ratio instead.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245282#M45753</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T20:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to use transpose to generate new tables and calculate relative risk with proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245292#M45755</link>
      <description>&lt;P&gt;I need to have each 2X2 tables, with the first one as the reference.&lt;/P&gt;&lt;P&gt;For each new table I generate, it is a kind of case control&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-transpose-to-generate-new-tables-and-calculate/m-p/245292#M45755</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-21T20:41:53Z</dc:date>
    </item>
  </channel>
</rss>

