<?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: PROC FREQ / SURVEYFREQ | Multiple 2-way Tables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863880#M38171</link>
    <description>&lt;P&gt;Since you didn't show any actual Proc freq or surveyfreq code the answer is "maybe".&lt;/P&gt;
&lt;P&gt;You can use ( ) to indicate a group of variables to compare with others in a table statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (a b c) * (d e) for example will do tables a*d b*d c*d a*e b*e c*e.&lt;/P&gt;
&lt;P&gt;So if you have a group of demographic variables such as sex, age group, race, ethnicity that you want to compare with responses like income those are easy. Have the demographics in one set of parentheses and the other responses in a different group.&lt;/P&gt;
&lt;P&gt;Or if you really want all with all , where you will get sex*sex as a result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tables (&amp;amp;cat_vars.) * (&amp;amp;cat_vars);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the truly lazy that want to generate horrific amounts of output perhaps: tables _all_ * _all_ ;&lt;/P&gt;
&lt;P&gt;The tables statements in Freq and Surveyfreq will accept the list words _all_ (every single variable), _numeric_ (all the numeric variables) and/or _character_ all of the character variables.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 19:02:23 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-03-13T19:02:23Z</dc:date>
    <item>
      <title>PROC FREQ / SURVEYFREQ | Multiple 2-way Tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863867#M38170</link>
      <description>&lt;P&gt;I want to create multiple 2-way tables to assess bivariate associations between categorical variables. Basically, I want all possible 2-way combinations of the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using a macro variable to represent the list of variables:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let cat_vars = 
	sex
	race_all
	edu
	hh_income
	etoh_days_per_wk
	smk_status
	lipid_meds 
	diab_meds 
	;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there syntax that will spare me from having to type out all possible combinations of these variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 18:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863867#M38170</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2023-03-13T18:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ / SURVEYFREQ | Multiple 2-way Tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863880#M38171</link>
      <description>&lt;P&gt;Since you didn't show any actual Proc freq or surveyfreq code the answer is "maybe".&lt;/P&gt;
&lt;P&gt;You can use ( ) to indicate a group of variables to compare with others in a table statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (a b c) * (d e) for example will do tables a*d b*d c*d a*e b*e c*e.&lt;/P&gt;
&lt;P&gt;So if you have a group of demographic variables such as sex, age group, race, ethnicity that you want to compare with responses like income those are easy. Have the demographics in one set of parentheses and the other responses in a different group.&lt;/P&gt;
&lt;P&gt;Or if you really want all with all , where you will get sex*sex as a result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tables (&amp;amp;cat_vars.) * (&amp;amp;cat_vars);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the truly lazy that want to generate horrific amounts of output perhaps: tables _all_ * _all_ ;&lt;/P&gt;
&lt;P&gt;The tables statements in Freq and Surveyfreq will accept the list words _all_ (every single variable), _numeric_ (all the numeric variables) and/or _character_ all of the character variables.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 19:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863880#M38171</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-13T19:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ / SURVEYFREQ | Multiple 2-way Tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863895#M38172</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyfreq data=work.data_2009_2018;
 	stratum sdmvstra;
 	cluster sdmvpsu;
 	weight wtmec10yr_09_18;
 	tables 	(&amp;amp;cat_vars)*(&amp;amp;cat_vars) / chisq;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;lt;Or if you really want all with all, where you will get sex*sex as a result&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I do, even though I would just disregard sex*sex, race*race and other 2-way tables involving the same variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use the syntax above, I get an error in the log:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-13 at 12.44.15 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81479i756546701544BD54/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-03-13 at 12.44.15 PM.png" alt="Screenshot 2023-03-13 at 12.44.15 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 19:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-SURVEYFREQ-Multiple-2-way-Tables/m-p/863895#M38172</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2023-03-13T19:47:53Z</dc:date>
    </item>
  </channel>
</rss>

