<?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 calculate relative risk, and 95%CI in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243486#M12839</link>
    <description>&lt;P&gt;I'm too lazy to make sample data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you post sample data and sample calculations someone can help with the code.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2016 15:41:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-14T15:41:52Z</dc:date>
    <item>
      <title>How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243243#M12814</link>
      <description>&lt;P&gt;I would like to know how to use SAS macro/array to calculate relative risk. It has 5 IDs, I need to calculate lower bound and upper bound.&lt;/P&gt;&lt;P&gt;Would any of you present me a code or a simiar example?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243243#M12814</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T16:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243244#M12815</link>
      <description>&lt;P&gt;Why do you want a macro or array?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq can calculate relative risk.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_freq_sect029.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_freq_sect029.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
      value ExpFmt 1='High Cholesterol Diet'
                   0='Low Cholesterol Diet';
      value RspFmt 1='Yes'
                   0='No';
   run;
   data FatComp;
      input Exposure Response Count;
      label Response='Heart Disease';
      datalines;
   0 0  6
   0 1  2
   1 0  4
   1 1 11
   ;
   proc sort data=FatComp;
      by descending Exposure descending Response;
   run;

  proc freq data=FatComp order=data;
      format Exposure ExpFmt. Response RspFmt.;
      tables Exposure*Response / chisq relrisk;
      exact pchi or;
      weight Count;
      title 'Case-Control Study of High Fat/Cholesterol Diet';
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:23:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243244#M12815</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-13T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243251#M12816</link>
      <description>&lt;P&gt;Thanks. Those are varibles that have more than two levels of catogory. (&amp;gt;2)&lt;/P&gt;&lt;P&gt;So I am looking for a code that can do this.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243251#M12816</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T16:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243253#M12817</link>
      <description>&lt;P&gt;Please provide sample data, expected output and some details surrounding your question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243253#M12817</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-13T16:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243258#M12818</link>
      <description>&lt;P&gt;agegroup &amp;lt;10 10-20 20-30 &amp;gt;30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the risk of surgery 2.37&amp;nbsp; 2.4&amp;nbsp; 2.8 3.2&amp;nbsp; (%)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I need to caculate the crude relatve risk, using &amp;lt;10 agegroup as a reference (1.00)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also want to caculate same things among different communities (up to five communities). This is why I want to use array and/or macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 17:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243258#M12818</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T17:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243290#M12819</link>
      <description>&lt;P&gt;You may need to provide additional information about how your current SAS data set is structured. For example, you give a percent which seem to be your current value. But what was the actual size of the sample that the percent was calculated from? Since you are asking for "upper and lower bounds" I am assuming that is a confidence interval you are requesting and the calculation for that will require the original sample size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can your print a few rows of your data to show us what it looks like? You may need restructuring to calculate the risks and confidence intervals.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 18:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243290#M12819</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-13T18:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243292#M12820</link>
      <description>&lt;P&gt;It is about 200,000 obs. For some age groups, it has 50,000. Others have more.&lt;/P&gt;&lt;P&gt;sorry, the data cannot be printed out. I just list an example that is very similar to my original data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to see whether there is any reference. I read some books and articles showing examples on variables with two catogories. But mine is over two. So it will be beneficial if there is code for three catogories or over three.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 18:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243292#M12820</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T18:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243299#M12821</link>
      <description>&lt;P&gt;You need to show us what your data looks like. Dummy values are fine but the structure of current data set is important.&lt;/P&gt;
&lt;P&gt;Does each record relate to a single person? Is that person in the data more than once? If a person is in the data more than once which record is to be used for the relative risk calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get ODDS ratios between a base group and other groups using Proc Logistic (and others).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking at age as a contributor to specific outcome you might want to look at a regression model which would yield a change in likelihood per year of age.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243299#M12821</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-13T19:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243303#M12822</link>
      <description>&lt;P&gt;I do not quite understand what "structure" you mean here.&lt;/P&gt;&lt;P&gt;In my dataset, some people have multiple records. But I have already disingushi this by using sort by their ID&lt;/P&gt;&lt;P&gt;relative risk is simply the rate I put and calculated by the total number of people. Then I need to calculate its related 95%CI.&lt;/P&gt;&lt;P&gt;I want to have a macro or array code to calculate since it has multiple subgroups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RR= count of patients who had surgery/total people&lt;/P&gt;&lt;P&gt;lower CI=exp(ln(RR-1.96????&amp;nbsp; (formula should be available available, but I cannot find code)&lt;/P&gt;&lt;P&gt;so it really does not matter how much my data looks like, I am looking for a sample code to deal with data with &amp;gt;2 catogories&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243303#M12822</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T19:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243327#M12823</link>
      <description>Of course it matters how your data is. For starters,   is your data already in counts, so can you divide two variables for RR? Or do you have individual level information and need to calculate the # of patients who had surgery and the total number?&lt;BR /&gt;How are your groups defined as well, is there a variable that defines your groups or multiple variables that have information for each group? &lt;BR /&gt;Typically subgroup analysis in SAS is via BY group processing, not macro or array. And sometimes transposing your data makes your analysis simpler.&lt;BR /&gt;&lt;BR /&gt;If you know exactly what you want and need help converting that to a macro or array please post what you have and someone can help from there. &lt;BR /&gt;Otherwise vague problem descriptions get vague answers.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jan 2016 20:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243327#M12823</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-13T20:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243333#M12824</link>
      <description>&lt;P&gt;my data is not already in counts. First, I used SQL to put those different datasets together (different communities). Then, I use proc freq to calculte counts. Then, I calculate RR.&lt;/P&gt;&lt;P&gt;I have to use excel to calculate, one by one, which is very slow. So I am thinking whether I can speed up with macro code&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 20:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243333#M12824</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T20:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243334#M12825</link>
      <description>&lt;P&gt;If a person is in your data more than once do you count them as a person (once for the entire data set) or each time they appear? How your result is interpreted depends on knowing that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How is a person treated in the counts if a person is in the data once in one age group without the surgery but then has the surgery when in another age group and then appears later in yet another age group?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you may be at a point where you need to go back to what the research question that is being asked is defined to get clarification on how to treat your data, probably such that a person only occurs once in the analysis.&amp;nbsp;At this point, I would not provide code on just how&amp;nbsp;to do multiple chi-sq tests as I would not want to be associated with any result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 21:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243334#M12825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-13T21:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243346#M12826</link>
      <description>&lt;P&gt;count only once&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the agegroup is classfied at the beginning of research, no more agegroup variable later&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we only analyze the patient once;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just as the first one who provided code for me---unfortunately, he provided a sample code for variables with two categories----that is same as what I have read and learned online. I need, in stead, a sample code for variables with more than two catogories, like age groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 21:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243346#M12826</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-13T21:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243372#M12827</link>
      <description>&lt;P&gt;Are you sure you need relative risk? With multiple levels I'm more used to seeing odds ratio.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You usually need case/control scenarios for relative risk.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 01:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243372#M12827</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-14T01:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243373#M12828</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40773"&gt;@Bal23&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;unfortunately, he&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;She&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 01:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243373#M12828</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-14T01:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243476#M12835</link>
      <description>&lt;P&gt;I am requried to calulate relative risks. Certainly, I am interested the codes that can do both works, calculating RR and OR.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243476#M12835</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-14T15:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243486#M12839</link>
      <description>&lt;P&gt;I'm too lazy to make sample data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you post sample data and sample calculations someone can help with the code.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243486#M12839</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-14T15:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243501#M12841</link>
      <description />
      <pubDate>Thu, 14 Jan 2016 16:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243501#M12841</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-14T16:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243502#M12842</link>
      <description>&lt;P&gt;&lt;STRONG&gt;relative risk&lt;/STRONG&gt; or &lt;STRONG&gt;risk ratio&lt;/STRONG&gt; (&lt;STRONG&gt;RR&lt;/STRONG&gt;) is the ratio of the &lt;A title="Probability" href="https://en.wikipedia.org/wiki/Probability" target="_blank"&gt;probability&lt;/A&gt; of an event occurring (for example, developing a disease, being injured) in an exposed group to the probability of the event occurring in a comparison, non-exposed group. Relative risk includes two important features: (i) a comparison of risk between two "exposures" puts risks in context, and (ii) "exposure" is ensured by having proper &lt;A title="Denominator" href="https://en.wikipedia.org/wiki/Denominator" target="_blank"&gt;denominators&lt;/A&gt; for each group representing the exposure &lt;A href="https://en.wikipedia.org/wiki/Relative_risk#cite_note-pmid14695382-1" target="_blank"&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;1&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Relative_risk#cite_note-2" target="_blank"&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;2&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://upload.wikimedia.org/math/c/7/c/c7c029314e633e290193caeab4cf2950.png" alt="RR={\frac {p_{\text{event when exposed}}}{p_{\text{event when non-exposed}}}}" border="0" /&gt;Risk Disease status Present Absent Smoker Non-smoker&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;IMG src="https://upload.wikimedia.org/math/0/c/c/0cc175b9c0f1b6a831c399e269772661.png" alt="a" border="0" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;IMG src="https://upload.wikimedia.org/math/9/2/e/92eb5ffee6ae2fec3ad71c777531578f.png" alt="b" border="0" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;IMG src="https://upload.wikimedia.org/math/4/a/8/4a8a08f09d37b73795649038408b5f33.png" alt="c" border="0" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;IMG src="https://upload.wikimedia.org/math/8/2/7/8277e0910d750195b448797616e091ad.png" alt="d" border="0" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Consider an example where the &lt;A title="Probability" href="https://en.wikipedia.org/wiki/Probability" target="_blank"&gt;probability&lt;/A&gt; of developing lung cancer among smokers was 20% and among non-smokers 1%. This situation is expressed in the 2&amp;nbsp;×&amp;nbsp;2 table to the right.&lt;/P&gt;&lt;P&gt;Here, &lt;I&gt;a&lt;/I&gt;&amp;nbsp;=&amp;nbsp;20, &lt;I&gt;b&lt;/I&gt;&amp;nbsp;=&amp;nbsp;80, &lt;I&gt;c&lt;/I&gt;&amp;nbsp;=&amp;nbsp;1, and &lt;I&gt;d&lt;/I&gt;&amp;nbsp;=&amp;nbsp;99. Then the relative risk of cancer associated with smoking would be&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://upload.wikimedia.org/math/1/1/0/11048b035c4f34de736080dbc2d3caaa.png" alt="RR={\frac {a/(a+b)}{c/(c+d)}}={\frac {20/100}{1/100}}=20." border="0" height="45" width="265" /&gt;&lt;/P&gt;&lt;P&gt;Smokers would be twenty times as likely as non-smok&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please note the first group's RR=1&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 16:19:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243502#M12842</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-14T16:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative risk, and 95%CI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243635#M12844</link>
      <description>&lt;P&gt;Your example data only shows the numbers of the event surgery, 2126 (implies nonsurger of 217486-2126. You do not have an exposure. The rate you calculated was a prevalence rate of surgery within the age group.&lt;/P&gt;
&lt;P align="LEFT"&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="497" dir="LTR" border="1" cellspacing="0" cellpadding="7"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="7" valign="TOP"&gt;
&lt;P&gt;&lt;FONT size="3"&gt;agegroup1&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="25%" height="7" valign="TOP"&gt;
&lt;P&gt;&lt;FONT size="3"&gt;217486&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="25%" height="7" valign="TOP"&gt;
&lt;P&gt;&lt;FONT size="3"&gt;2126&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="25%" height="7" valign="TOP"&gt;
&lt;P&gt;&lt;FONT size="3"&gt;2126/21746*100&lt;/FONT&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the definition you post shows that the exposure group, which I have to assume, you have been attempting to use agegroup, can only have two levels. You can do RR for agegroup1 vs agegroup2, agegroup1 vs agegroup3 and agegroup2 vs agegroup3 but not all 3 at once. What you are attempting really is much more in the way of odds ratios where compare the ratio to a base group, likely the one with the lowest prevalence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The value you show 2126/21746 * 100 = 9.776. I could not tell from your data how you get a relative risk of 1, there is not another exposure group. Please show the values for a, b, c and d&amp;nbsp;you used to get a 1.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-relative-risk-and-95-CI/m-p/243635#M12844</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-14T23:05:23Z</dc:date>
    </item>
  </channel>
</rss>

