<?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: Two-By-Two frequency tables with all variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565300#M158697</link>
    <description>&lt;P&gt;Thank you, it was really helpful to know these tricks with variables as they can probably be applied in other Proc's.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2019 15:39:37 GMT</pubDate>
    <dc:creator>JackyK</dc:creator>
    <dc:date>2019-06-11T15:39:37Z</dc:date>
    <item>
      <title>Two-By-Two frequency tables with all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565093#M158583</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For simple 1-way frequencies I know Proc Freq can do all variables in a data set if I just don't specify anything in the table option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would like to create 2-by-2 tables with say variable Z.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if my data set have columns W X Y Z, I would do:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data = have;
     table W*Z X*Z Y*Z;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But my data set has like 70 variables. I was wondering if there is a way to this with all variables, or all but certain variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jacky&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 02:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565093#M158583</guid>
      <dc:creator>JackyK</dc:creator>
      <dc:date>2019-06-11T02:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Two-By-Two frequency tables with all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565099#M158586</link>
      <description>&lt;P&gt;You have a few options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. If the variables are all in order in the table (column order) you can list the first and last variables only, with double hyphens in between (--).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.heart (obs=50);
table ageAtStart *(bp_status--smoking_status);
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If the variables have a similar prefix you can use the colon short cut notation&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.heart (obs=50);
table ageAtStart *(chol:);
run;
&lt;/PRE&gt;
&lt;P&gt;3. If neither applies you can list all, though you'll get one extra table of X*X. _all_ refers to all variables, _numeric_ all numeric and _character_ is all character variables.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.heart (Obs=50);
table ageAtStart * (_all_);
table ageAtStart * (_numeric_);
table ageAtStart * (_character_);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271262"&gt;@JackyK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For simple 1-way frequencies I know Proc Freq can do all variables in a data set if I just don't specify anything in the table option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I would like to create 2-by-2 tables with say variable Z.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if my data set have columns W X Y Z, I would do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data = have;
     table W*Z X*Z Y*Z;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But my data set has like 70 variables. I was wondering if there is a way to this with all variables, or all but certain variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jacky&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 02:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565099#M158586</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-11T02:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Two-By-Two frequency tables with all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565298#M158696</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271262"&gt;@JackyK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For simple 1-way frequencies I know Proc Freq can do all variables in a data set if I just don't specify anything in the table option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I would like to create 2-by-2 tables with say variable Z.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if my data set have columns W X Y Z, I would do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data = have;
     table W*Z X*Z Y*Z;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But my data set has like 70 variables. I was wondering if there is a way to this with all variables, or all but certain variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jacky&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You may want to think about how many values per variable are involved and now many tables (70*70= 4900) you will generate as you quite possibly can fill up a results window or spend a &lt;STRONG&gt;long&lt;/STRONG&gt; time waiting for the tables to render.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I remember a job similar to this at one place I worked when all output was sent to a line printer. And finding 8&amp;nbsp;full paper boxes of output waiting.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 15:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565298#M158696</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-11T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Two-By-Two frequency tables with all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565300#M158697</link>
      <description>&lt;P&gt;Thank you, it was really helpful to know these tricks with variables as they can probably be applied in other Proc's.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 15:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-By-Two-frequency-tables-with-all-variables/m-p/565300#M158697</guid>
      <dc:creator>JackyK</dc:creator>
      <dc:date>2019-06-11T15:39:37Z</dc:date>
    </item>
  </channel>
</rss>

