<?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: Comparing two independent samples for count data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767913#M37551</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; : Thanks for your criticism. I am aware of the assumptions of the three procedures that were suggested.&amp;nbsp;In many cases, count data are well-approximated by a normal distribution, but you are certainly entitled to your opinion. If there were more data, we could debate the issue, but a debate seems pointless when the OP's data contains 5 observations. For the posted data, I doubt it matters which method is used.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Sep 2021 14:35:05 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-09-15T14:35:05Z</dc:date>
    <item>
      <title>Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767807#M37534</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out what test would be appropriate to compare two independent samples for count data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;input year city1 city2;&lt;BR /&gt;datalines;&lt;BR /&gt;2016 220 130&lt;BR /&gt;2017 140 180&lt;BR /&gt;2018 120 202&lt;BR /&gt;2019 140 134&lt;BR /&gt;2020 135 166&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have any denominators for the cities by year (for instance the frequencies in the city1 and city2 represent number of traffic accidents for each year). If I want to test if the number of traffic accidents differ by the cities what test I can use?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 23:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767807#M37534</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-09-14T23:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767809#M37535</link>
      <description>&lt;P&gt;1. First standardize for the population or # of drivers or # of cars in each city&lt;/P&gt;
&lt;P&gt;2. Then look at PROC FREQ with either a chi-square test or a cochran-armitage test.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want to account for year, sum them up and use ChiSquare.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to account for year, use Cochran-Armitage&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_freq_details76.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/statug/15.2/statug_freq_details76.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Standardization is important here. If I compare a city of 1 million to a city of 5 million the accident counts should not be expected to be the same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122505"&gt;@Recep&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to figure out what test would be appropriate to compare two independent samples for count data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;input year city1 city2;&lt;BR /&gt;datalines;&lt;BR /&gt;2016 220 130&lt;BR /&gt;2017 140 180&lt;BR /&gt;2018 120 202&lt;BR /&gt;2019 140 134&lt;BR /&gt;2020 135 166&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have any denominators for the cities by year (for instance the frequencies in the city1 and city2 represent number of traffic accidents for each year). If I want to test if the number of traffic accidents differ by the cities what test I can use?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767809#M37535</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-15T00:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767811#M37536</link>
      <description>Hi Reeza,&lt;BR /&gt;Thanks a lot for your response but as I mentioned in my question I do not have any sort of denominator information. The example I provided was fictitious. You can assume instead of number of accidents those are the number of meteorites that fell into each city from the sky and I want to know if one city has more meteorites fallen than the other one.&lt;BR /&gt;Cheers....&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Sep 2021 01:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767811#M37536</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-09-15T01:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767818#M37537</link>
      <description>&lt;P&gt;Then go find the spatial area of your city. That’s likely constant over time at least so just two values to look up. Otherwise, you’re comparing apples and oranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122505"&gt;@Recep&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Reeza,&lt;BR /&gt;Thanks a lot for your response but as I mentioned in my question I do not have any sort of denominator information. The example I provided was fictitious. You can assume instead of number of accidents those are the number of meteorites that fell into each city from the sky and I want to know if one city has more meteorites fallen than the other one.&lt;BR /&gt;Cheers....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 02:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767818#M37537</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-15T02:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767887#M37541</link>
      <description>&lt;P&gt;You could try K-S test.&lt;/P&gt;
&lt;PRE&gt;data test;
input year city1 city2;
datalines;
2016 220 130
2017 140 180
2018 120 202
2019 140 134
2020 135 166
;
data have;
 set test;
 city='city1';count=city1;output;
 city='city2';count=city2;output;
 keep city count;
run;

proc npar1way data=have plots=edfplot edf ;
class city;
var count;
run;&lt;/PRE&gt;
&lt;P&gt;But your case is special due to have YEAR variable.&lt;/P&gt;
&lt;P&gt;Maybe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp; have some good idea .&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 12:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767887#M37541</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-15T12:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767893#M37544</link>
      <description>&lt;P&gt;You could try a paired t test. The procedure includes graphical output to help you assess whether the data might satisfy the assumptions of the test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc ttest data=test;
   paired city1*city2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Sep 2021 13:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767893#M37544</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-09-15T13:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767898#M37545</link>
      <description>&lt;P&gt;Count data are typically modeled using the Poisson or negative binomial distribution. Such models are easily fit in procedures like GENMOD, GLIMMIX, and HPGENSELECT. For example, the following fits a model using the negative binomial distribution which accommodates overdispersion in the data.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input year city1 city2;
y=city1; city=1; output;
y=city2; city=2; output;
datalines;
2016 220 130
2017 140 180
2018 120 202
2019 140 134
2020 135 166
;
proc genmod;
class city;
model y=city / dist=negbin;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Sep 2021 13:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767898#M37545</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-09-15T13:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767904#M37548</link>
      <description>Rick,&lt;BR /&gt;I like your idea. But ttest is parameter method ,NOT non-parameter method like K-S test.&lt;BR /&gt;proc ttest is usually suited for NORMAL data ,not count data I think !</description>
      <pubDate>Wed, 15 Sep 2021 14:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767904#M37548</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-15T14:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767913#M37551</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; : Thanks for your criticism. I am aware of the assumptions of the three procedures that were suggested.&amp;nbsp;In many cases, count data are well-approximated by a normal distribution, but you are certainly entitled to your opinion. If there were more data, we could debate the issue, but a debate seems pointless when the OP's data contains 5 observations. For the posted data, I doubt it matters which method is used.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 14:35:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767913#M37551</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-09-15T14:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767938#M37554</link>
      <description>&lt;P&gt;Thanks a lot Dave! Then I'm assuming that the p-value (0.5548 in this example) will tell if the two cities are statistically significantly different from each other (or more technically, in this example, we have no reason to reject the null hypothesis which assumes there is no difference between two cities).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 17:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767938#M37554</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-09-15T17:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767949#M37555</link>
      <description>If this is for homework go with that. If this is for decision making, then what I said earlier still applies and you cannot compare the raw numbers.</description>
      <pubDate>Wed, 15 Sep 2021 17:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767949#M37555</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-15T17:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two independent samples for count data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767954#M37556</link>
      <description>&lt;P&gt;Yes, that's correct.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 18:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Comparing-two-independent-samples-for-count-data/m-p/767954#M37556</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-09-15T18:04:29Z</dc:date>
    </item>
  </channel>
</rss>

