<?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 What test to perform? Two categorical variables, but data are correlated in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/What-test-to-perform-Two-categorical-variables-but-data-are/m-p/571060#M28096</link>
    <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I'm leaning towards some variations of Chi-Squares test. Particularly MH-Chisq but I would like to confirm before proceeding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data structure is as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input StudyID location$ X1 X2;
    datalines;
    1 N 0 0
    1 E 0 1
    1 S 1 1
    2 N 1 1
    2 W 1 1
    2 E 1 0
    2 S 1 1
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;StudyID&lt;/STRONG&gt; - the subject ID ranges from 0-200&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;location&lt;/STRONG&gt; - Categorical variable with possible values N,W,S,E. Each subject has measurements at taken at different locations, with a maximum of 4 different locations and minimum of 1 location.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;X1 and X2&lt;/STRONG&gt; - binary variables Yes/No type. I would like to test and see if there is any associations between X1 and X2.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I believe the ordinary Chi-Square test runs under the assumption that observations are independent. But in my case I believe the observations are correlated within subjects. Is there a variation of the chi-square test where it takes the correlated data into consideration?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 19:23:12 GMT</pubDate>
    <dc:creator>JackyK</dc:creator>
    <dc:date>2019-07-03T19:23:12Z</dc:date>
    <item>
      <title>What test to perform? Two categorical variables, but data are correlated</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-test-to-perform-Two-categorical-variables-but-data-are/m-p/571060#M28096</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I'm leaning towards some variations of Chi-Squares test. Particularly MH-Chisq but I would like to confirm before proceeding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data structure is as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input StudyID location$ X1 X2;
    datalines;
    1 N 0 0
    1 E 0 1
    1 S 1 1
    2 N 1 1
    2 W 1 1
    2 E 1 0
    2 S 1 1
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;StudyID&lt;/STRONG&gt; - the subject ID ranges from 0-200&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;location&lt;/STRONG&gt; - Categorical variable with possible values N,W,S,E. Each subject has measurements at taken at different locations, with a maximum of 4 different locations and minimum of 1 location.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;X1 and X2&lt;/STRONG&gt; - binary variables Yes/No type. I would like to test and see if there is any associations between X1 and X2.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I believe the ordinary Chi-Square test runs under the assumption that observations are independent. But in my case I believe the observations are correlated within subjects. Is there a variation of the chi-square test where it takes the correlated data into consideration?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 19:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-test-to-perform-Two-categorical-variables-but-data-are/m-p/571060#M28096</guid>
      <dc:creator>JackyK</dc:creator>
      <dc:date>2019-07-03T19:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: What test to perform? Two categorical variables, but data are correlated</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-test-to-perform-Two-categorical-variables-but-data-are/m-p/571100#M28100</link>
      <description>&lt;P&gt;If each subject has only one pair of measurements at each location, then you could use the CMH option in PROC FREQ to test the association in the table stratified by location. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq;
  table location*x1*x2 / cmh;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 21:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-test-to-perform-Two-categorical-variables-but-data-are/m-p/571100#M28100</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2019-07-03T21:32:22Z</dc:date>
    </item>
  </channel>
</rss>

