<?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: Subset question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Subset-question/m-p/724912#M28041</link>
    <description>&lt;P&gt;Sounds like you could do that with just a different WHERE clause.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where (c_ses3='&lt;SPAN&gt;cPLTL&lt;/SPAN&gt;' and tutoring between 2 and 3)
   or (c_ses3='non-&lt;SPAN&gt;cPLTL&lt;/SPAN&gt;' and tutoring between 3 and 4)
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Mar 2021 16:41:58 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-03-09T16:41:58Z</dc:date>
    <item>
      <title>Subset question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Subset-question/m-p/724908#M28040</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to run a Chi squared test on some data I collected. Here is an example of my dataset:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mcmaxwell_0-1615307201568.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55739i0014CFBEE29FB3F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mcmaxwell_0-1615307201568.png" alt="mcmaxwell_0-1615307201568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;c_ses3 has two levels (cPLTL or non-cPLTL) and refers to whether a student participated in a teaching intervention or not. ABC has two levels (ABC or DFW) and refers to a students final grade. Tutoring refers to how many tutoring sessions a student attended and ranges from 0 to 12. ST_c has 6 levels (0-1, 1-2, 2-3, 3-4, 4-5, 6+) and represents how much time a student spent studying weekly.&lt;/P&gt;&lt;P&gt;I used the code below to do the chi squared test:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** get contingency table and run chisq**/     
proc freq data=all;    
	title "cPLTL 2-3h ST vs. non-cPLTL 3-4h ST";    
	table c_ses3 * ABC / chisq expected nopercent nocol norow;     
	where tutoring between 0 and 3;    
	run;    &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see, I am comparing the ABC rates of cPLTL and non-cPLTL groups, and I am only using students who attended 0, 1, 2, or 3 tutoring sessions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Here is my problem&lt;/U&gt;: I would like to specifically compare &lt;STRONG&gt;cPLTL students who studied 2-3 hours&lt;/STRONG&gt; with &lt;STRONG&gt;non-cPLTL students who studied 3-4 hours&lt;/STRONG&gt;. I am not sure how to write the code to subset the &lt;STRONG&gt;ST_c&lt;/STRONG&gt; variable because the way it should be subsetted depends on the &lt;STRONG&gt;c_ses3&lt;/STRONG&gt; variable. &lt;U&gt;Is there a way to do this? Or a different way I could organize my data?&lt;/U&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!!!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Subset-question/m-p/724908#M28040</guid>
      <dc:creator>mcmaxwell</dc:creator>
      <dc:date>2021-03-09T16:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subset question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Subset-question/m-p/724912#M28041</link>
      <description>&lt;P&gt;Sounds like you could do that with just a different WHERE clause.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where (c_ses3='&lt;SPAN&gt;cPLTL&lt;/SPAN&gt;' and tutoring between 2 and 3)
   or (c_ses3='non-&lt;SPAN&gt;cPLTL&lt;/SPAN&gt;' and tutoring between 3 and 4)
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Subset-question/m-p/724912#M28041</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-09T16:41:58Z</dc:date>
    </item>
  </channel>
</rss>

