<?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: proc power in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/454738#M23754</link>
    <description>More complicated than I hoped for, but thanks</description>
    <pubDate>Tue, 17 Apr 2018 13:54:58 GMT</pubDate>
    <dc:creator>karlbang</dc:creator>
    <dc:date>2018-04-17T13:54:58Z</dc:date>
    <item>
      <title>proc power</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/453641#M23704</link>
      <description>&lt;P&gt;I am doing a sample size calculation for two proportions (alpha=0.05, beta=0.2 (i.e. power=0.8)). Group proportions are fixed at&amp;nbsp;0.05 and 0.0375, respectively. If I decide on N=4555 subjects in one group how many subjects do I need to include in the other group ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc power;
	ods output Power.TwoSampleFreq.Output=out;
	twosamplefreq
	GROUPPROPORTIONS = (0.05 0.0375)
	groupns=(4555 .)
	power = 0.80
	alpha = .05;
run;&lt;/PRE&gt;&lt;P&gt;fails me. Any suggestions ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 16:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/453641#M23704</guid>
      <dc:creator>karlbang</dc:creator>
      <dc:date>2018-04-12T16:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc power</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/454706#M23753</link>
      <description>&lt;P&gt;I suggest to simulate with different numbers, and find the right N for which the probability for rejecting becomes 80%. I assume it is a two side test, so we can test the hypothesis of equal proportions with a likelihood test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The calculation of p-values so simple here that it can be calculated within a datastep. It turns out that about 3865 should be in the other group in order to get a probability of rejecting=80% (that is the power).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data simulation;
  array n{2} _temporary_ (4555,3865);
  array p{2} _temporary_ (0.05,0.0375);
  array y_{2} _temporary_;
  do i=1 to 1000000;
    l0=0;
    do k=1 to 2;
	  outcome=1;y=rand('binomial',p[k],n[k]);y_[k]=y;l0+y*log(y/n[k]);
      outcome=0;y=n[k]-y; l0+y*log(y/n[k]);
	end;
	l1=(y_[1]+y_[2])*log((y_[1]+y_[2])/(n[1]+n[2]))+
	   (n[1]+n[2]-y_[1]-y_[2])*log(1-(y_[1]+y_[2])/(n[1]+n[2]));
	minus2logQ=-2*(l1-l0);
	pvalue=sdf('chisquare',minus2logQ,1);
	reject=(pvalue&amp;lt;0.05);
	output;
  end;
  keep minus2logQ reject;
run;
proc means data=simulation mean;
  var reject;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I edited a bit, as first I said about 4000 in the other group. Increasing the number of simulations shows that 3865 is more accurate).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 13:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/454706#M23753</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2018-04-17T13:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc power</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/454738#M23754</link>
      <description>More complicated than I hoped for, but thanks</description>
      <pubDate>Tue, 17 Apr 2018 13:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-power/m-p/454738#M23754</guid>
      <dc:creator>karlbang</dc:creator>
      <dc:date>2018-04-17T13:54:58Z</dc:date>
    </item>
  </channel>
</rss>

