<?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: repeated chi-square tests in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57402#M2680</link>
    <description>I slightly mis-interpreted the I (etc.) as a space. But your input file is still not correct, as I indicated in my original message. You need three values for each combination.</description>
    <pubDate>Mon, 03 Jan 2011 15:36:46 GMT</pubDate>
    <dc:creator>lvm</dc:creator>
    <dc:date>2011-01-03T15:36:46Z</dc:date>
    <item>
      <title>repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57398#M2676</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
neeed some help in this.&lt;BR /&gt;
&lt;BR /&gt;
I am currently using this program to run the chi sq/fishers exact test:&lt;BR /&gt;
DATA;&lt;BR /&gt;
INPUT FLOWERS $ COLOURS $ COUNT @@;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
A I 18 II 15 III 12&lt;BR /&gt;
B I 44 II 43 III 34&lt;BR /&gt;
C I 34 II 31 III 37&lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
PROC FREQ;&lt;BR /&gt;
WEIGHT COUNT;&lt;BR /&gt;
TABLES flowers*colours;&lt;BR /&gt;
EXACT FISHER;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
However, this is just for an individual observation and I have many rows of data, with each observation tabulated as a 3x3 table. Is there a macro that can run a chisq/fishers exact test for every 3 rows of data?&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Mon, 03 Jan 2011 03:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57398#M2676</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-03T03:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57399#M2677</link>
      <description>You should be able to use a BY statement in PROC FREQ</description>
      <pubDate>Mon, 03 Jan 2011 14:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57399#M2677</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2011-01-03T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57400#M2678</link>
      <description>I tried inserting the BY statement but then the chi square test gets messed up.</description>
      <pubDate>Mon, 03 Jan 2011 14:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57400#M2678</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-03T14:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57401#M2679</link>
      <description>Before dealing with multiple tests, your input data file is not what you think. You are specifying that the first flower type is A and the first colour type is "18", with a count of 12. Because of the @@, the next flower type is "12", the next colour is "B", with a count of "44". And so on. If your really have three flower types (and how many colours?), you should best have three values per record:&lt;BR /&gt;
Flower, Colour, Count&lt;BR /&gt;
If you have 3 flower types and 3 colour types (as an example), you would have 9 records.&lt;BR /&gt;
Then, the rest of your code would work fine.&lt;BR /&gt;
&lt;BR /&gt;
If you want to analyze several groups, you need a fourth variable per record, indicating the group. &lt;BR /&gt;
Group, Flower, Colour, Count&lt;BR /&gt;
There would be nine records for each of the groups. You would need to sort by Group, before the FREQ analysis.&lt;BR /&gt;
LVM</description>
      <pubDate>Mon, 03 Jan 2011 15:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57401#M2679</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-01-03T15:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57402#M2680</link>
      <description>I slightly mis-interpreted the I (etc.) as a space. But your input file is still not correct, as I indicated in my original message. You need three values for each combination.</description>
      <pubDate>Mon, 03 Jan 2011 15:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57402#M2680</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-01-03T15:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57403#M2681</link>
      <description>Will this input data file work instead?&lt;BR /&gt;
&lt;BR /&gt;
DATA;&lt;BR /&gt;
DO flower = 1 TO 3;&lt;BR /&gt;
DO colour = I TO III;&lt;BR /&gt;
INPUT WT @@;&lt;BR /&gt;
OUTPUT;&lt;BR /&gt;
END;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
18 15 12&lt;BR /&gt;
44 43 34&lt;BR /&gt;
34 31 37&lt;BR /&gt;
;&lt;BR /&gt;
PROC FREQ;&lt;BR /&gt;
WEIGHT WT;&lt;BR /&gt;
TABLES flower*colour;&lt;BR /&gt;
EXACT FISHER&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
The end result is such that flower type 1 has three colours, with 18 having colour I, 15 having colour II and 12 having colour III, and a total of 45.&lt;BR /&gt;
&lt;BR /&gt;
The same goes for flower type 2.&lt;BR /&gt;
&lt;BR /&gt;
If I have to sort by Group, do I just have to put in the data for Group under the datalines as well?</description>
      <pubDate>Mon, 03 Jan 2011 16:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57403#M2681</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-03T16:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: repeated chi-square tests</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57404#M2682</link>
      <description>Your do loops won't work right, separate from the analysis. It is always a good idea to print the data file before the analysis to make sure you have what you think you have. I can't get into the do loop rules, but here is a direct way of getting what you want. I repeated your data a second time to show two groups. Make sure the groups are in order. There can be any number of groups.&lt;BR /&gt;
&lt;BR /&gt;
DATA a;&lt;BR /&gt;
INPUT group FLOWERS $ COLOURS $ COUNT ;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
1 A I 18 &lt;BR /&gt;
1 A II 15 &lt;BR /&gt;
1 A III 12&lt;BR /&gt;
1 B I 44 &lt;BR /&gt;
1 B II 43 &lt;BR /&gt;
1 B III 34&lt;BR /&gt;
1 C I 34 &lt;BR /&gt;
1 C II 31 &lt;BR /&gt;
1 C III 37&lt;BR /&gt;
2 A I 18 &lt;BR /&gt;
2 A II 15 &lt;BR /&gt;
2 A III 12&lt;BR /&gt;
2 B I 44 &lt;BR /&gt;
2 B II 43 &lt;BR /&gt;
2 B III 34&lt;BR /&gt;
2 C I 34 &lt;BR /&gt;
2 C II 31 &lt;BR /&gt;
2 C III 37&lt;BR /&gt;
;&lt;BR /&gt;
proc print data=a;&lt;BR /&gt;
RUN;&lt;BR /&gt;
PROC FREQ data=a;&lt;BR /&gt;
by group;&lt;BR /&gt;
WEIGHT COUNT;&lt;BR /&gt;
TABLES flowers*colours;&lt;BR /&gt;
EXACT FISHER;&lt;BR /&gt;
RUN;</description>
      <pubDate>Mon, 03 Jan 2011 17:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/repeated-chi-square-tests/m-p/57404#M2682</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-01-03T17:22:03Z</dc:date>
    </item>
  </channel>
</rss>

