<?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 weird results about sample size of logistic regression in power analysis in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579044#M164324</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I used R to get a sample size I need for a logistic regression study.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; wp.logistic(n = NULL, p0 = 0.5, p1 = 0.6, alpha = 0.05,&lt;BR /&gt;+ power = 0.8, family = "normal", parameter = c(0,1))&lt;BR /&gt;R said I need a sample N=214 if I want to discover a significant difference of .1 (p2=.6 and p1=.5, p2-p1=.1), at alpha=.05, power=.8.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use SAS to find the sample size based on the covariates I would like to have , it gives me smaller sample sizes (N=168, N=175) than N=214 when I want alpha=.05 and power=.8. Who can help me figure out what is going on? R said N at least should be 214 even without covariates. So I think adding covariates the required sample size should be at least more than N=214.&lt;/P&gt;&lt;P&gt;proc power;&lt;BR /&gt;logistic&lt;BR /&gt;vardist("recidivism") = BINOMIAL (0.5, 1)&lt;BR /&gt;vardist("gender") = BINOMIAL (0.5, 1)&lt;BR /&gt;vardist("self-control") = ordinal((2 4 6) : (0.4 0.4 0.2))&lt;BR /&gt;vardist("age") = normal(24, 6)&lt;BR /&gt;vardist("income") = normal(2400, 600)&lt;BR /&gt;testpredictor = "recidivism"&lt;BR /&gt;covariates = "gender"|"self-control" "age" "income"&lt;BR /&gt;responseprob = 0.5 0.6 .07&lt;BR /&gt;testoddsratio = 2.4&lt;BR /&gt;alpha = 0.05&lt;BR /&gt;power = 0.8&lt;BR /&gt;ntotal = .;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20190804194559.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31517iED991036C06CE4FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="20190804194559.png" alt="20190804194559.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Aug 2019 23:48:31 GMT</pubDate>
    <dc:creator>Lindy</dc:creator>
    <dc:date>2019-08-04T23:48:31Z</dc:date>
    <item>
      <title>weird results about sample size of logistic regression in power analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579044#M164324</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I used R to get a sample size I need for a logistic regression study.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; wp.logistic(n = NULL, p0 = 0.5, p1 = 0.6, alpha = 0.05,&lt;BR /&gt;+ power = 0.8, family = "normal", parameter = c(0,1))&lt;BR /&gt;R said I need a sample N=214 if I want to discover a significant difference of .1 (p2=.6 and p1=.5, p2-p1=.1), at alpha=.05, power=.8.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use SAS to find the sample size based on the covariates I would like to have , it gives me smaller sample sizes (N=168, N=175) than N=214 when I want alpha=.05 and power=.8. Who can help me figure out what is going on? R said N at least should be 214 even without covariates. So I think adding covariates the required sample size should be at least more than N=214.&lt;/P&gt;&lt;P&gt;proc power;&lt;BR /&gt;logistic&lt;BR /&gt;vardist("recidivism") = BINOMIAL (0.5, 1)&lt;BR /&gt;vardist("gender") = BINOMIAL (0.5, 1)&lt;BR /&gt;vardist("self-control") = ordinal((2 4 6) : (0.4 0.4 0.2))&lt;BR /&gt;vardist("age") = normal(24, 6)&lt;BR /&gt;vardist("income") = normal(2400, 600)&lt;BR /&gt;testpredictor = "recidivism"&lt;BR /&gt;covariates = "gender"|"self-control" "age" "income"&lt;BR /&gt;responseprob = 0.5 0.6 .07&lt;BR /&gt;testoddsratio = 2.4&lt;BR /&gt;alpha = 0.05&lt;BR /&gt;power = 0.8&lt;BR /&gt;ntotal = .;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20190804194559.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31517iED991036C06CE4FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="20190804194559.png" alt="20190804194559.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 23:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579044#M164324</guid>
      <dc:creator>Lindy</dc:creator>
      <dc:date>2019-08-04T23:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: weird results about sample size of logistic regression in power analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579051#M164327</link>
      <description>&lt;P&gt;If R and SAS are using different algorithms, the results don't have to give comparable results. So, if I were you, I'd try to figure out if the same algorithms are being used; or just pick one and go with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ancient Hekawe saying: Man with one watch knows what time it is. Man with two watches never sure. (If you are not familiar with the &lt;A href="https://en.wikipedia.org/wiki/F_Troop#The_Hekawi_tribe" target="_self"&gt;Hekawe tribe&lt;/A&gt;, they appeared on the USA comedy TV show "F-Troop" in the 1960s)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 00:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579051#M164327</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-08-05T00:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: weird results about sample size of logistic regression in power analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579058#M164328</link>
      <description>&lt;P&gt;Thank you so much for your help! I am quite an armature in using SAS for power analysis. If it is at your convenience, could you please provide me with the several line of SAS code I should use for this task?&lt;/P&gt;&lt;P&gt;The rate of a type of disease in the general population is &lt;STRONG&gt;50%&lt;/STRONG&gt;, and I am giving a group of randomly selected people a type of vitamin to observe if the vitamin can decrease the rate of disease in this treatment group. I want to be able to identify the significant effect as long as there is &lt;STRONG&gt;40%&lt;/STRONG&gt; rate of this disease in my treatment group at alpha .05 and power .80. What sample size minimally I should have?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 02:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579058#M164328</guid>
      <dc:creator>Lindy</dc:creator>
      <dc:date>2019-08-05T02:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: weird results about sample size of logistic regression in power analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579113#M164353</link>
      <description>&lt;P&gt;What is wrong with the results from the SAS code that you ran?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 12:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/weird-results-about-sample-size-of-logistic-regression-in-power/m-p/579113#M164353</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-08-05T12:33:17Z</dc:date>
    </item>
  </channel>
</rss>

