<?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: Calculating Relative Risk Estimate given power and known sample size in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Relative-Risk-Estimate-given-power-and-known-sample/m-p/589632#M75947</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290924"&gt;@jenoli525&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You raise a good point. PROC POWER can solve only for power or sample size (be it total or per group), although asking for relative risk, given power, sample size and reference proportion, is an obvious, legitimate question, at least from a purely mathematical point of view. Maybe they want to nudge you towards specifying the relative risk based on subject-matter considerations, e.g., what is clinically relevant. Technically, it would be no problem at all to extend the capabilities of PROC POWER correspondingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can still use the procedure to obtain the desired result:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set npergroup (or power) to missing and specify a range of relative risks.&lt;/LI&gt;
&lt;LI&gt;Refine and restrict the range to the interval in which the resulting npergroup in the previous step crossed 5000 (or the power crossed 0.8, resp.).&lt;/LI&gt;
&lt;LI&gt;Repeat step 2 until the desired precision is attained.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, in your example there are &lt;EM&gt;two&lt;/EM&gt; numeric solutions for the relative risk RR=p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;/p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;/0.02, depending on whether the second proportion,&amp;nbsp;p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;, is less than or greater than reference proportion p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.02. In the latter case (the other case is done analogously) you could start with something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplefreq test=pchi
relativerisk= 1.1 to 2 by 0.1
refproportion= 0.02
npergroup = .
power = 0.8;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the results you see that the solution for relative risk must be between 1.4 and 1.5:&lt;/P&gt;
&lt;PRE&gt;          Computed N per Group

            Relative    Actual     N per
   Index        Risk     Power     Group

       1         1.1     0.800     80682
       2         1.2     0.800     21109
       3         1.3     0.800      9798
       4         1.4     0.800      5745
       5         1.5     0.800      3826
       6         1.6     0.800      2760
       7         1.7     0.800      2103
       8         1.8     0.800      1668
       9         1.9     0.800      1364
      10         2.0     0.800      1141&lt;/PRE&gt;
&lt;P&gt;So, in the next step you would use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.4 to 1.5 by 0.01&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and continue similarly with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.43 to 1.44 by 0.001&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.431 to 1.432 by 0.0001&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To see more decimals than in the default output of PROC POWER you may want to write the results to an ODS output dataset by using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output output=pow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The final results, obtained with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=pow;
var rel: np:;
format relativerisk 6.4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;are&lt;/P&gt;
&lt;PRE&gt;       Relative    NPer
Obs      Risk      Group

  1     1.4310      5010
  2     1.4311      5008
  3     1.4312      5006
  4     1.4313      5004
  5     1.4314      5002
  6     1.4315      5000
  7     1.4316      4998
  8     1.4317      4995
  9     1.4318      4993
 10     1.4319      4991
 11     1.4320      4989&lt;/PRE&gt;
&lt;P&gt;So, &lt;STRONG&gt;1.4315&lt;/STRONG&gt; is the relative risk in question.&lt;/P&gt;
&lt;P&gt;The solution with p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;&amp;lt;p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&amp;nbsp;(obtained analogously) is &lt;STRONG&gt;0.6438&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 12:55:50 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2019-09-18T12:55:50Z</dc:date>
    <item>
      <title>Calculating Relative Risk Estimate given power and known sample size</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Relative-Risk-Estimate-given-power-and-known-sample/m-p/589509#M75943</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to find the estimated relative risk given certain parameters in a power calculation. The example is for a randomized control trial with 5000 in the treatment group and 5000 in the placebo group with an estimated 2% of the placebo with the outcome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To solve for the relative risk given these characteristics, I have tried the following code but there is an error message for the RR being missing...even though that is what I am trying to solve for. Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;power&lt;/STRONG&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;twosamplefreq test=pchi&lt;/P&gt;&lt;P&gt;relativerisk= &lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;refproportion= &lt;STRONG&gt;0.02&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;npergroup = &lt;STRONG&gt;5000&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;power = &lt;STRONG&gt;0.8&lt;/STRONG&gt;;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 01:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Relative-Risk-Estimate-given-power-and-known-sample/m-p/589509#M75943</guid>
      <dc:creator>jenoli525</dc:creator>
      <dc:date>2019-09-18T01:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Relative Risk Estimate given power and known sample size</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Relative-Risk-Estimate-given-power-and-known-sample/m-p/589632#M75947</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290924"&gt;@jenoli525&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You raise a good point. PROC POWER can solve only for power or sample size (be it total or per group), although asking for relative risk, given power, sample size and reference proportion, is an obvious, legitimate question, at least from a purely mathematical point of view. Maybe they want to nudge you towards specifying the relative risk based on subject-matter considerations, e.g., what is clinically relevant. Technically, it would be no problem at all to extend the capabilities of PROC POWER correspondingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can still use the procedure to obtain the desired result:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set npergroup (or power) to missing and specify a range of relative risks.&lt;/LI&gt;
&lt;LI&gt;Refine and restrict the range to the interval in which the resulting npergroup in the previous step crossed 5000 (or the power crossed 0.8, resp.).&lt;/LI&gt;
&lt;LI&gt;Repeat step 2 until the desired precision is attained.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, in your example there are &lt;EM&gt;two&lt;/EM&gt; numeric solutions for the relative risk RR=p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;/p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;/0.02, depending on whether the second proportion,&amp;nbsp;p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;, is less than or greater than reference proportion p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.02. In the latter case (the other case is done analogously) you could start with something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplefreq test=pchi
relativerisk= 1.1 to 2 by 0.1
refproportion= 0.02
npergroup = .
power = 0.8;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the results you see that the solution for relative risk must be between 1.4 and 1.5:&lt;/P&gt;
&lt;PRE&gt;          Computed N per Group

            Relative    Actual     N per
   Index        Risk     Power     Group

       1         1.1     0.800     80682
       2         1.2     0.800     21109
       3         1.3     0.800      9798
       4         1.4     0.800      5745
       5         1.5     0.800      3826
       6         1.6     0.800      2760
       7         1.7     0.800      2103
       8         1.8     0.800      1668
       9         1.9     0.800      1364
      10         2.0     0.800      1141&lt;/PRE&gt;
&lt;P&gt;So, in the next step you would use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.4 to 1.5 by 0.01&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and continue similarly with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.43 to 1.44 by 0.001&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;relativerisk= 1.431 to 1.432 by 0.0001&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To see more decimals than in the default output of PROC POWER you may want to write the results to an ODS output dataset by using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output output=pow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The final results, obtained with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=pow;
var rel: np:;
format relativerisk 6.4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;are&lt;/P&gt;
&lt;PRE&gt;       Relative    NPer
Obs      Risk      Group

  1     1.4310      5010
  2     1.4311      5008
  3     1.4312      5006
  4     1.4313      5004
  5     1.4314      5002
  6     1.4315      5000
  7     1.4316      4998
  8     1.4317      4995
  9     1.4318      4993
 10     1.4319      4991
 11     1.4320      4989&lt;/PRE&gt;
&lt;P&gt;So, &lt;STRONG&gt;1.4315&lt;/STRONG&gt; is the relative risk in question.&lt;/P&gt;
&lt;P&gt;The solution with p&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;&amp;lt;p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&amp;nbsp;(obtained analogously) is &lt;STRONG&gt;0.6438&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 12:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Relative-Risk-Estimate-given-power-and-known-sample/m-p/589632#M75947</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-09-18T12:55:50Z</dc:date>
    </item>
  </channel>
</rss>

