<?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: run many outcomes by many risk factors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609176#M177348</link>
    <description>&lt;P&gt;Not sure that by statement in proc freq would work here - wouldn't it generate chi square tests per every level of the by variable? I'd need just one chisq per outcome*risk factor combination.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 20:54:52 GMT</pubDate>
    <dc:creator>antonsvart</dc:creator>
    <dc:date>2019-12-03T20:54:52Z</dc:date>
    <item>
      <title>run many outcomes by many risk factors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609161#M177340</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking to conduct chi square tests for 9 outcome variables each by 29 potential risk factors (i.e., outcome #1 by risk factor #1, then risk factor #2, etc., then outcome #2 by risk factor #1 then risk factor #2, etc.).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far, I've conceived this piece of code, but I'm not sure how to execute it without somehow attaching numbers to my outcomes and to my risk factors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

%do i=1 to &amp;amp;outcome_&amp;amp;i;
%do j=1 to &amp;amp;rf_&amp;amp;j;
		proc freq data=myData ;
	        table &amp;amp;outcome_&amp;amp;i*&amp;amp;rf_&amp;amp;j/chisq;
		run;
%end; /*end risk factor loop*/
%end; /*end outcome loop*/


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609161#M177340</guid>
      <dc:creator>antonsvart</dc:creator>
      <dc:date>2019-12-03T20:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: run many outcomes by many risk factors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609165#M177343</link>
      <description>Don't think you need macros. I think you need one to be a BY statement instead. &lt;BR /&gt;&lt;BR /&gt;It'll depend a bit on your table structure, which you may need to change but you don't need macros for this.</description>
      <pubDate>Tue, 03 Dec 2019 20:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609165#M177343</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-03T20:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: run many outcomes by many risk factors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609176#M177348</link>
      <description>&lt;P&gt;Not sure that by statement in proc freq would work here - wouldn't it generate chi square tests per every level of the by variable? I'd need just one chisq per outcome*risk factor combination.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609176#M177348</guid>
      <dc:creator>antonsvart</dc:creator>
      <dc:date>2019-12-03T20:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: run many outcomes by many risk factors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609182#M177352</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;proc freq data=myData ;
   table &amp;lt;list of outcome variables * &amp;lt;list of risk variables&amp;gt;j/chisq;
   run;
&lt;/PRE&gt;
&lt;P&gt;When you use a tables statement like&lt;/P&gt;
&lt;P&gt;Tables (a b c) * (x y z) you get results for all of the pairs: a*x a*y a*z b*x b*y b*z c*x c*y c*z.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 21:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609182#M177352</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-03T21:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: run many outcomes by many risk factors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609191#M177354</link>
      <description>&lt;P&gt;Depends on your data structure. I'm assuming you have a structure something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;riskfactor outcome result
1               1            8
1                1           4
....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Restructuring your data is also pretty straightforward to get this which then helps facilitate a lot of further analysis quite easily.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tidy data rules should be followed, in general, it saves you time overall.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 21:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-many-outcomes-by-many-risk-factors/m-p/609191#M177354</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-03T21:38:49Z</dc:date>
    </item>
  </channel>
</rss>

