<?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: Test for difference in proportions in two sample (with sub-categories) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859399#M82501</link>
    <description>Thank you, Rick!&lt;BR /&gt;That worked! As this is large survey data, I have avoided doing By-group analyses and have only used survey procedures - surveyfreq etc, so somehow, I forgot this was an option &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Thanks again!</description>
    <pubDate>Fri, 17 Feb 2023 15:34:14 GMT</pubDate>
    <dc:creator>ZeeM_31</dc:creator>
    <dc:date>2023-02-17T15:34:14Z</dc:date>
    <item>
      <title>Test for difference in proportions in two sample (with sub-categories)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859143#M82499</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm working with national survey data that ask people if they have participated in a cancer screening program, something like - "Have You Ever Taken the Cancer Test?" - Yes/No.&lt;/P&gt;&lt;P&gt;I have two different years of the survey, 2010 &amp;amp; 2015 and have calculated the proportion of people who answered Yes for all the Provinces, for both survey year, but I'd also like to test if there's significant difference in the proportion of people who have screened in 2010 vs 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the data and what I have tried:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data screen_rates;&lt;BR /&gt;input Year $ Province $ Screen $ count;&lt;BR /&gt;datalines;&lt;BR /&gt;cchs2010 A Yes 54&lt;BR /&gt;cchs2010 A No 46&lt;BR /&gt;cchs2010 B Yes 53&lt;BR /&gt;cchs2010 B No 47&lt;BR /&gt;cchs2010 C Yes 55&lt;BR /&gt;cchs2010 C No 45&lt;BR /&gt;cchs2010 D Yes 54&lt;BR /&gt;cchs2010 D No 46&lt;BR /&gt;cchs2017 A Yes 48&lt;BR /&gt;cchs2017 A No 52&lt;BR /&gt;cchs2017 B Yes 43&lt;BR /&gt;cchs2017 B No 57&lt;BR /&gt;cchs2017 C Yes 51&lt;BR /&gt;cchs2017 C No 49&lt;BR /&gt;cchs2017 D Yes 49&lt;BR /&gt;cchs2017 D No 51&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data= screen_rates;&lt;BR /&gt;tables Year*Province*Screen /chisq riskdiff;&lt;BR /&gt;weight Count;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I saw this message in the log:&amp;nbsp;RISKDIFF statistics are computed only for 2x2 tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there should be a way to test the proportions for each province in 2010 vs 2015 for significance, but nothing has worked for me thus far. I appreciate suggestions and ideas. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 08:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859143#M82499</guid>
      <dc:creator>ZeeM_31</dc:creator>
      <dc:date>2023-02-16T08:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Test for difference in proportions in two sample (with sub-categories)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859168#M82500</link>
      <description>&lt;P&gt;It sounds like you want to perform independent analyses for each Province. If so, sort by Province and perform a BY-group analysis:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data screen_rates;
input Year $ Province $ Screen $ count;
datalines;
cchs2010 A Yes 54
cchs2010 A No 46
cchs2010 B Yes 53
cchs2010 B No 47
cchs2010 C Yes 55
cchs2010 C No 45
cchs2010 D Yes 54
cchs2010 D No 46
cchs2017 A Yes 48
cchs2017 A No 52
cchs2017 B Yes 43
cchs2017 B No 57
cchs2017 C Yes 51
cchs2017 C No 49
cchs2017 D Yes 49
cchs2017 D No 51
;
 
proc sort data=screen_rates;
   by Province Year;
run;

proc freq data= screen_rates;
   by Province;
   tables Year*Screen /chisq riskdiff;
   weight Count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2023 11:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859168#M82500</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-02-16T11:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Test for difference in proportions in two sample (with sub-categories)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859399#M82501</link>
      <description>Thank you, Rick!&lt;BR /&gt;That worked! As this is large survey data, I have avoided doing By-group analyses and have only used survey procedures - surveyfreq etc, so somehow, I forgot this was an option &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Fri, 17 Feb 2023 15:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859399#M82501</guid>
      <dc:creator>ZeeM_31</dc:creator>
      <dc:date>2023-02-17T15:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Test for difference in proportions in two sample (with sub-categories)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859441#M82502</link>
      <description>&lt;P&gt;Your TABLES request, Year*Province*Screen, produces a table of Province*Screen (a 4x2 table) for each level of Year. But it sounds like you actually want a 2x2 table of Year*Screen for each Province. In that case, an alternative (to using a BY statement) is to specify the multiway table as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TABLES Province * Year * Screen / chisq riskdiff;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For RISKDIFF, this is equivalent to specifying Province in a BY statement. But specifying the multiway table form allows you to compute stratified statistics (like COMMONRISKDIFF) if you need that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 19:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859441#M82502</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2023-02-17T19:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Test for difference in proportions in two sample (with sub-categories)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859647#M82503</link>
      <description>&lt;P&gt;Thank you, Watts&lt;/P&gt;&lt;P&gt;This was very helpful!&lt;/P&gt;</description>
      <pubDate>Sun, 19 Feb 2023 20:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Test-for-difference-in-proportions-in-two-sample-with-sub/m-p/859647#M82503</guid>
      <dc:creator>ZeeM_31</dc:creator>
      <dc:date>2023-02-19T20:30:43Z</dc:date>
    </item>
  </channel>
</rss>

