<?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 power in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581680#M165345</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/245291"&gt;@SSin&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to compare proportions in two independent populations, so the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;TWOSAMPLEFREQ statement&lt;/A&gt; is more appropriate. I take it that 55% and 45% are the proportions vaccinated with NH and SH, respectively, so that the corresponding absolute numbers are about 2413+1974=4387. (By using the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqnfractional" target="_blank" rel="noopener"&gt;NFRACTIONAL&lt;/A&gt; option you don't have to worry about the fact that 0.55*4387 is not an integer.) Your code suggests that you prefer an exact test, which would be Fisher's exact test in the two-sample case. Since the sample sizes are fixed, the power of the test depends on the (true) incidence rates in the two groups. So, you need to specify these, which can be done in several different ways (see section "Specify Effects" in table &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug_power006628" target="_blank" rel="noopener"&gt;"Summary of Options"&lt;/A&gt;). One method is to specify&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;a &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqrefproportion" target="_blank" rel="noopener"&gt;reference proportion&lt;/A&gt;, i.e. the incidence rate &lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt; in one group, say, the NH group and&lt;/LI&gt;
&lt;LI&gt;the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqrelativerisk" target="_blank" rel="noopener"&gt;relative risk&lt;/A&gt;, i.e. the incidence rate &lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt; in the other group, divided by&amp;nbsp;&lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;You can specify value lists for both options. Then it makes sense to request a plot (which you did), but not with &lt;FONT face="courier new,courier"&gt;x=n&lt;/FONT&gt; (because n=4387 is fixed), but with &lt;FONT face="courier new,courier"&gt;x=effect&lt;/FONT&gt; (i.e. the relative risk in the example above).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a code example using fake data for REFPROPORTION and RELATIVERISK:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplefreq
  test=fisher
  alpha = 0.05
  refproportion = 0.005 to 0.010 by 0.0025
  relativerisk = 0.33 to 0.83 by 0.05, 1.2 to 3 by 0.2
  groupweights = (0.55 0.45)
  nfractional
  ntotal = 4387
  power = .;
plot x=effect;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Aug 2019 10:56:54 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2019-08-16T10:56:54Z</dc:date>
    <item>
      <title>How to calculate power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581637#M165334</link>
      <description>&lt;P&gt;I am trying to compare incidence of flu in two groups of population ; one who got vaccinated with Northern Hemisphere Vaccine (NH)and the other with Southern Hemisphere Vaccine (SH). Proportions of populations are 55% in NH and 45% in SH. Total sample size (NH+SH) is 4,387.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am trying to know the power of this sample size for this comparison. I used the following code. The result shows computed power is &amp;gt;0.999. But I am not sure the code I used is correct or not.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc power;&lt;BR /&gt;	onesamplefreq test=exact sides=1 proportion=0.55 nullproportion=0.45 &lt;BR /&gt;		ntotal=4387 alpha=0.05 power=.;&lt;BR /&gt;	plot x=n;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Please let me know what is the correct code&amp;nbsp; to get power of that sample size. Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 02:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581637#M165334</guid>
      <dc:creator>SSin</dc:creator>
      <dc:date>2019-08-16T02:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581639#M165335</link>
      <description>A one sample freq test is not appropriate for your data/experiment IMO, but I'm also not familiar enough with PROC POWER to tell you what is.</description>
      <pubDate>Fri, 16 Aug 2019 03:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581639#M165335</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-16T03:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581644#M165337</link>
      <description>Thank you for the comment. If one sample freq test is not appropriate please let me know what is appropriate test. Thank you.</description>
      <pubDate>Fri, 16 Aug 2019 03:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581644#M165337</guid>
      <dc:creator>SSin</dc:creator>
      <dc:date>2019-08-16T03:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581680#M165345</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/245291"&gt;@SSin&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to compare proportions in two independent populations, so the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;TWOSAMPLEFREQ statement&lt;/A&gt; is more appropriate. I take it that 55% and 45% are the proportions vaccinated with NH and SH, respectively, so that the corresponding absolute numbers are about 2413+1974=4387. (By using the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqnfractional" target="_blank" rel="noopener"&gt;NFRACTIONAL&lt;/A&gt; option you don't have to worry about the fact that 0.55*4387 is not an integer.) Your code suggests that you prefer an exact test, which would be Fisher's exact test in the two-sample case. Since the sample sizes are fixed, the power of the test depends on the (true) incidence rates in the two groups. So, you need to specify these, which can be done in several different ways (see section "Specify Effects" in table &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug_power006628" target="_blank" rel="noopener"&gt;"Summary of Options"&lt;/A&gt;). One method is to specify&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;a &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqrefproportion" target="_blank" rel="noopener"&gt;reference proportion&lt;/A&gt;, i.e. the incidence rate &lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt; in one group, say, the NH group and&lt;/LI&gt;
&lt;LI&gt;the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.power.powtfrqrelativerisk" target="_blank" rel="noopener"&gt;relative risk&lt;/A&gt;, i.e. the incidence rate &lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt; in the other group, divided by&amp;nbsp;&lt;EM&gt;p&lt;/EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;You can specify value lists for both options. Then it makes sense to request a plot (which you did), but not with &lt;FONT face="courier new,courier"&gt;x=n&lt;/FONT&gt; (because n=4387 is fixed), but with &lt;FONT face="courier new,courier"&gt;x=effect&lt;/FONT&gt; (i.e. the relative risk in the example above).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a code example using fake data for REFPROPORTION and RELATIVERISK:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplefreq
  test=fisher
  alpha = 0.05
  refproportion = 0.005 to 0.010 by 0.0025
  relativerisk = 0.33 to 0.83 by 0.05, 1.2 to 3 by 0.2
  groupweights = (0.55 0.45)
  nfractional
  ntotal = 4387
  power = .;
plot x=effect;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Aug 2019 10:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-power/m-p/581680#M165345</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-08-16T10:56:54Z</dc:date>
    </item>
  </channel>
</rss>

