<?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: Sample Size and Power Calculation for difference in median in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sample-Size-and-Power-Calculation-for-difference-in-median/m-p/967708#M376423</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438304"&gt;@VioletaB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have two independent samples with a location shift between their (otherwise ideally equal) distributions, I would suggest the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_power_syntax112.htm" target="_blank" rel="noopener"&gt;TWOSAMPLEWILCOXON statement&lt;/A&gt; of PROC POWER. Note, however, that the expected median difference and estimated standard deviation (together with power and significance level) do not provide sufficient information for the sample size calculation. Sample size for the Wilcoxon rank-sum test also depends on the &lt;EM&gt;shape&lt;/EM&gt; of the distribution. This is why there is the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_power_syntax112.htm#statug.power.powwlcxvardist" target="_blank" rel="noopener"&gt;VARDIST option&lt;/A&gt; where you need to specify the distributions of the two samples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: Normal distributions with SD=1.2, shifted by |&lt;FONT face="symbol"&gt;m&lt;/FONT&gt;&lt;SUB&gt;1&lt;/SUB&gt;−&lt;FONT face="symbol"&gt;m&lt;/FONT&gt;&lt;SUB&gt;2&lt;/SUB&gt;|=1&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplewilcoxon
vardist('Group 1')=normal(0, 1.2)
vardist('Group 2')=normal(1, 1.2)
variables = 'Group 1' | 'Group 2'
sides = 2
alpha = 0.05
power = 0.85
npergroup = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result: n=28 per group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the more heavy-tailed &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n164yyfgppedmkn1320boncqkh6r.htm#n0z5oajwid1s3on13rsukmsiza91" target="_blank" rel="noopener"&gt;Laplace distribution&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;vardist('Group 1')=laplace(0, 0.848528)
vardist('Group 2')=laplace(1, 0.848528)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the result is only n=21 per group, although the median difference and standard deviation (sqrt(2)*0.848528...=1.2) are the same as for the normal distributions above.&lt;/P&gt;</description>
    <pubDate>Thu, 29 May 2025 12:18:50 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2025-05-29T12:18:50Z</dc:date>
    <item>
      <title>Sample Size and Power Calculation for difference in median</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-Size-and-Power-Calculation-for-difference-in-median/m-p/967696#M376418</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate sample size per group (or total) for difference in Median. So i have information what diff in median i expect (effect) and estimated SD, want 90% power and alpha=0.05. How can i calculate sample size in SAS for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 08:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-Size-and-Power-Calculation-for-difference-in-median/m-p/967696#M376418</guid>
      <dc:creator>VioletaB</dc:creator>
      <dc:date>2025-05-29T08:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sample Size and Power Calculation for difference in median</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-Size-and-Power-Calculation-for-difference-in-median/m-p/967708#M376423</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438304"&gt;@VioletaB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have two independent samples with a location shift between their (otherwise ideally equal) distributions, I would suggest the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_power_syntax112.htm" target="_blank" rel="noopener"&gt;TWOSAMPLEWILCOXON statement&lt;/A&gt; of PROC POWER. Note, however, that the expected median difference and estimated standard deviation (together with power and significance level) do not provide sufficient information for the sample size calculation. Sample size for the Wilcoxon rank-sum test also depends on the &lt;EM&gt;shape&lt;/EM&gt; of the distribution. This is why there is the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_power_syntax112.htm#statug.power.powwlcxvardist" target="_blank" rel="noopener"&gt;VARDIST option&lt;/A&gt; where you need to specify the distributions of the two samples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: Normal distributions with SD=1.2, shifted by |&lt;FONT face="symbol"&gt;m&lt;/FONT&gt;&lt;SUB&gt;1&lt;/SUB&gt;−&lt;FONT face="symbol"&gt;m&lt;/FONT&gt;&lt;SUB&gt;2&lt;/SUB&gt;|=1&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplewilcoxon
vardist('Group 1')=normal(0, 1.2)
vardist('Group 2')=normal(1, 1.2)
variables = 'Group 1' | 'Group 2'
sides = 2
alpha = 0.05
power = 0.85
npergroup = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result: n=28 per group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the more heavy-tailed &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n164yyfgppedmkn1320boncqkh6r.htm#n0z5oajwid1s3on13rsukmsiza91" target="_blank" rel="noopener"&gt;Laplace distribution&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;vardist('Group 1')=laplace(0, 0.848528)
vardist('Group 2')=laplace(1, 0.848528)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the result is only n=21 per group, although the median difference and standard deviation (sqrt(2)*0.848528...=1.2) are the same as for the normal distributions above.&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 12:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-Size-and-Power-Calculation-for-difference-in-median/m-p/967708#M376423</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-05-29T12:18:50Z</dc:date>
    </item>
  </channel>
</rss>

