<?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: Controlling for a variable using ChiSq in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210679#M52095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;At the start of proc freq documentation , there is an example like yours . You can find here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FREQ procedure provides easy access to statistics for testing for association in a crosstabulation&lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;In this example, high school students applied for courses in a summer enrichment program; these&lt;/P&gt;&lt;P&gt;courses included journalism, art history, statistics, graphic arts, and computer programming. The&lt;/P&gt;&lt;P&gt;students accepted were randomly assigned to classes with and without internships in local companies.&lt;/P&gt;&lt;P&gt;Table 3.1 contains counts of the students who enrolled in the summer program by gender and whether&lt;/P&gt;&lt;P&gt;they were assigned an internship slot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 3.1 Summer Enrichment Data&lt;/P&gt;&lt;P&gt;Enrollment&lt;/P&gt;&lt;P&gt;Gender Internship Yes No Total&lt;/P&gt;&lt;P&gt;boys yes 35 29 64&lt;/P&gt;&lt;P&gt;boys no 14 27 41&lt;/P&gt;&lt;P&gt;girls yes 32 10 42&lt;/P&gt;&lt;P&gt;girls no 53 23 76&lt;/P&gt;&lt;P&gt;The SAS data set SummerSchool is created by inputting the summer enrichment data as cell count&lt;/P&gt;&lt;P&gt;data, or providing the frequency count for each combination of variable values. The following DATA&lt;/P&gt;&lt;P&gt;step statements create the SAS data set SummerSchool:&lt;/P&gt;&lt;P&gt;data SummerSchool;&lt;/P&gt;&lt;P&gt;input Gender $ Internship $ Enrollment $ Count @@;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;boys yes yes 35 boys yes no 29&lt;/P&gt;&lt;P&gt;boys no yes 14 boys no no 27&lt;/P&gt;&lt;P&gt;girls yes yes 32 girls yes no 10&lt;/P&gt;&lt;P&gt;girls no yes 53 girls no no 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;The variableGender takes the values ‘boys’ or ‘girls,’ the variableInternship takes the values ‘yes’&lt;/P&gt;&lt;P&gt;and ‘no,’ and the variableEnrollment takes the values ‘yes’ and ‘no.’ The variableCount contains the&lt;/P&gt;&lt;P&gt;number of students that correspond to each combination of data values. The double at sign (@@)&lt;/P&gt;&lt;P&gt;indicates that more than one observation is included on a single data line. In this DATA step, two&lt;/P&gt;&lt;P&gt;observations are included on each line.&lt;/P&gt;&lt;P&gt;Researchers are interested in whether there is an association between internship status and summer&lt;/P&gt;&lt;P&gt;program enrollment. The Pearson chi-square statistic is an appropriate statistic to assess the&lt;/P&gt;&lt;P&gt;association in the corresponding 2 2 table. The following PROC FREQ statements specify this&lt;/P&gt;&lt;P&gt;analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Mar 2015 13:08:47 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2015-03-27T13:08:47Z</dc:date>
    <item>
      <title>Controlling for a variable using ChiSq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210676#M52092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hi!&amp;nbsp; I'm a bit far removed from the chi square test and controlling for a variable (which I once must've learned way back when?).&lt;/P&gt;&lt;P&gt;I'm trying to see if facility type is a confounding factor in a chi-square analysis where I use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=keep&lt;/P&gt;&lt;P&gt;tables type*category*missing_doses/chisq;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm was initially trying to see if facilities within a certain category were more likely to have kids missing doses.&lt;/P&gt;&lt;P&gt;So I used the above code but without the 'type*'.&amp;nbsp; And I got a significant chi-sq value (p&amp;lt;.0001)&lt;/P&gt;&lt;P&gt;But,&amp;nbsp; I wanted to make sure that the facility type wasn't causing the significant outcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I added the 'type*' in the above code and when I look at both facility types, the chisq value isn't significant. &lt;/P&gt;&lt;P&gt;Does that mean there really is no significant difference and that type is a confounder? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm so far removed from this that I just don't remember what it means to control for a variable ( I only remember if you don't control for a confounding variable, it can create a false association)&lt;/P&gt;&lt;P&gt;And what does it mean that you get a significant result looking at all facility types.&lt;/P&gt;&lt;P&gt;But, when you control for facility types, the significant results go away?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help you can give is greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 00:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210676#M52092</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2015-03-26T00:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling for a variable using ChiSq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210677#M52093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'd use cmh option when you are process a two more dimensions contingency table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc freq data=keep&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;tables type*category*missing_doses/chisq cmh ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;So, I added the 'type*' in the above code and when I look at both facility types, the chisq value isn't significant.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Does that mean there really is no significant difference and that type is a confounder?"&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I am afraid so . If you add one more variable , the result could be totally different .&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;You'd better check FREQ documention , especially its examples , there is one almost like yours . (about student sex enrollment trainee )&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210677#M52093</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-26T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling for a variable using ChiSq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210678#M52094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Appreciate your help. I only found under sas documentation examples an example about hair color.&amp;nbsp; Where is the example you're referring to.&lt;/P&gt;&lt;P&gt;I guess I cannot control for a variable using chisq but I can using cmh?&lt;/P&gt;&lt;P&gt;When I controlled for type using chi sq (the above code without cmh) it wasn't significant. But when I used cmh, p&amp;lt;.0001.Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210678#M52094</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2015-03-26T15:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling for a variable using ChiSq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210679#M52095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;At the start of proc freq documentation , there is an example like yours . You can find here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FREQ procedure provides easy access to statistics for testing for association in a crosstabulation&lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;In this example, high school students applied for courses in a summer enrichment program; these&lt;/P&gt;&lt;P&gt;courses included journalism, art history, statistics, graphic arts, and computer programming. The&lt;/P&gt;&lt;P&gt;students accepted were randomly assigned to classes with and without internships in local companies.&lt;/P&gt;&lt;P&gt;Table 3.1 contains counts of the students who enrolled in the summer program by gender and whether&lt;/P&gt;&lt;P&gt;they were assigned an internship slot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 3.1 Summer Enrichment Data&lt;/P&gt;&lt;P&gt;Enrollment&lt;/P&gt;&lt;P&gt;Gender Internship Yes No Total&lt;/P&gt;&lt;P&gt;boys yes 35 29 64&lt;/P&gt;&lt;P&gt;boys no 14 27 41&lt;/P&gt;&lt;P&gt;girls yes 32 10 42&lt;/P&gt;&lt;P&gt;girls no 53 23 76&lt;/P&gt;&lt;P&gt;The SAS data set SummerSchool is created by inputting the summer enrichment data as cell count&lt;/P&gt;&lt;P&gt;data, or providing the frequency count for each combination of variable values. The following DATA&lt;/P&gt;&lt;P&gt;step statements create the SAS data set SummerSchool:&lt;/P&gt;&lt;P&gt;data SummerSchool;&lt;/P&gt;&lt;P&gt;input Gender $ Internship $ Enrollment $ Count @@;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;boys yes yes 35 boys yes no 29&lt;/P&gt;&lt;P&gt;boys no yes 14 boys no no 27&lt;/P&gt;&lt;P&gt;girls yes yes 32 girls yes no 10&lt;/P&gt;&lt;P&gt;girls no yes 53 girls no no 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;The variableGender takes the values ‘boys’ or ‘girls,’ the variableInternship takes the values ‘yes’&lt;/P&gt;&lt;P&gt;and ‘no,’ and the variableEnrollment takes the values ‘yes’ and ‘no.’ The variableCount contains the&lt;/P&gt;&lt;P&gt;number of students that correspond to each combination of data values. The double at sign (@@)&lt;/P&gt;&lt;P&gt;indicates that more than one observation is included on a single data line. In this DATA step, two&lt;/P&gt;&lt;P&gt;observations are included on each line.&lt;/P&gt;&lt;P&gt;Researchers are interested in whether there is an association between internship status and summer&lt;/P&gt;&lt;P&gt;program enrollment. The Pearson chi-square statistic is an appropriate statistic to assess the&lt;/P&gt;&lt;P&gt;association in the corresponding 2 2 table. The following PROC FREQ statements specify this&lt;/P&gt;&lt;P&gt;analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 13:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210679#M52095</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-27T13:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling for a variable using ChiSq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210680#M52096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 20:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Controlling-for-a-variable-using-ChiSq/m-p/210680#M52096</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2015-03-31T20:00:55Z</dc:date>
    </item>
  </channel>
</rss>

