<?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: How to run the same code for different data? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763962#M37291</link>
    <description>&lt;P&gt;Can we get a clarification?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say: "&lt;SPAN&gt;if I have several hundred data..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Does this mean several hundred data sets, or several hundred variables in one data set, or one variable but with an ID indicating several hundred families? Or something else?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Regardless of your answer, what are you going to do with 800 model fits, and 800 plots (times several different versions of the plots)? That makes me shiver. OF course you can ask the computer to produce all of that, but the problem is really how can a human look at and absorb all of that information?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Reminds me of a quote from Gomez Addams as he is about to saw his wife Morticia in half. Morticia asks: "Gomez, do you really know how to saw a woman in half?" And Gomez replies, "Of course, its putting her back together that is the problem".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You might want to instead of plotting put all the tests for normality (and any other tests) into one large data set, but even then the question remains ... and then what?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Aug 2021 19:01:44 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-08-25T19:01:44Z</dc:date>
    <item>
      <title>How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763951#M37286</link>
      <description>&lt;P&gt;Hello, if I have several hundred data need to run the same code, how could I analyze them without repeating writing the same codes? For example, I have family 1 to family 800.&amp;nbsp;Thank you very much in advance for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data= cecal_family_taxonomy; 
  class treatment block;
  model Family1P = treatment; 
  random block; 
  lsmeans treatment/tdiff lines;
  ods output LSMeans = myparmdataset;
  output out=second predicted=pred residual=resid residual(noblup)=mresid student=sresid student(noblup)=smresid;
  title "1-Taxonomy Data Cecal Family 1 Percentage ANOVA Results";
run;
proc print data=myparmdataset;
format estimate D8.6
       stderr D8.6;
run;
proc print data=second;
run;
proc sgplot data=second;
  scatter y=smresid x=pred;
  refline 0;
run;
proc sgplot data=second;
  scatter y=smresid x=treatment;
  refline 0;
run;
proc sgplot data=second;
  vbox smresid/group=treatment datalabel;
run;
proc sgscatter data=second;
  plot sresid*(pred treatment block);
run;
proc univariate data=second normal plot;
  var sresid;
  histogram sresid / normal kernel;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 18:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763951#M37286</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-25T18:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763958#M37288</link>
      <description>&lt;P&gt;Use a BY statement on a sorted dataset.&amp;nbsp; If family takes on values from 1 to 800, then just add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by family;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;after you invoke PROC GLIMMIX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 18:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763958#M37288</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-25T18:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763962#M37291</link>
      <description>&lt;P&gt;Can we get a clarification?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say: "&lt;SPAN&gt;if I have several hundred data..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Does this mean several hundred data sets, or several hundred variables in one data set, or one variable but with an ID indicating several hundred families? Or something else?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Regardless of your answer, what are you going to do with 800 model fits, and 800 plots (times several different versions of the plots)? That makes me shiver. OF course you can ask the computer to produce all of that, but the problem is really how can a human look at and absorb all of that information?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Reminds me of a quote from Gomez Addams as he is about to saw his wife Morticia in half. Morticia asks: "Gomez, do you really know how to saw a woman in half?" And Gomez replies, "Of course, its putting her back together that is the problem".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You might want to instead of plotting put all the tests for normality (and any other tests) into one large data set, but even then the question remains ... and then what?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 19:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763962#M37291</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-25T19:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763968#M37293</link>
      <description>&lt;P&gt;Few different ways to get at this, usually involving either BY group processing or macros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;has suggested the BY option, I'll show the macro solutions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One big difference is how you're interpret or parse the output. For the BY you'll have each step together but not all the results for one model, which may be a better formatted output. In general, though I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;,&amp;nbsp;this isn't particularily a practical approach, especially the multiple prints and plots.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UCLA introductory tutorial on macro variables and macros&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Tutorial on converting a working program to a macro &amp;lt;- this will illustrate how to run it many times for different data sets&lt;/STRONG&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Examples of common macro usage&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/339127"&gt;@kellychan84&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, if I have several hundred data need to run the same code, how could I analyze them without repeating writing the same codes? For example, I have family 1 to family 800.&amp;nbsp;Thank you very much in advance for your help!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data= cecal_family_taxonomy; 
  class treatment block;
  model Family1P = treatment; 
  random block; 
  lsmeans treatment/tdiff lines;
  ods output LSMeans = myparmdataset;
  output out=second predicted=pred residual=resid residual(noblup)=mresid student=sresid student(noblup)=smresid;
  title "1-Taxonomy Data Cecal Family 1 Percentage ANOVA Results";
run;
proc print data=myparmdataset;
format estimate D8.6
       stderr D8.6;
run;
proc print data=second;
run;
proc sgplot data=second;
  scatter y=smresid x=pred;
  refline 0;
run;
proc sgplot data=second;
  scatter y=smresid x=treatment;
  refline 0;
run;
proc sgplot data=second;
  vbox smresid/group=treatment datalabel;
run;
proc sgscatter data=second;
  plot sresid*(pred treatment block);
run;
proc univariate data=second normal plot;
  var sresid;
  histogram sresid / normal kernel;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 19:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763968#M37293</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-25T19:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763973#M37294</link>
      <description>&lt;P&gt;It would be pretty easy to loop this up in a macro - you would only need a where=(family=&amp;amp;fam_no) sort of addition to the data=cecal_family_taxonomy statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I worry about something else entirely.&amp;nbsp; In the title, you refer to Percentage ANOVA results.&amp;nbsp; Is your dependent variable a percentage?&amp;nbsp; If so, looking at all of the residuals, etc. could be dispensed with if you used a generalized mixed model, and specified that your response variable was binomial (assuming it is counts of family X/total count).&amp;nbsp; PROC GLIMMIX is specifically designed for this.&amp;nbsp; The diagnostic plots generated with the plots=all option should enable you to see if there was any significant overdispersion (extra variability) in your results.&amp;nbsp; As we have pointed out before, the assumptions of homogeneous variance, independence and normality of residuals is not critical to mixed models, and even less important to generalized mixed models.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 19:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763973#M37294</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-25T19:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763985#M37296</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; It is &lt;SPAN&gt;several hundred variables in one data set&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 19:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763985#M37296</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-25T19:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763995#M37297</link>
      <description>This is likely a good quick read for you as well.&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html&lt;/A&gt;</description>
      <pubDate>Wed, 25 Aug 2021 20:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763995#M37297</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-25T20:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763997#M37298</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;You are right, my data are presented as percentages (&lt;SPAN&gt;counts of family X/total count). But I don't have any experience with the BY statement and macro statement. If possible, do you mind giving me an example of how to insert relevant codes into my procedure? My supervisor always wants to see my homogeneity test results before the comparisons of treatments. That's why I keep this several lines of codes here.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 20:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/763997#M37298</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-25T20:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764050#M37299</link>
      <description>&lt;P&gt;I know you're getting lots of advice, but in this case I would recommend (as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; did) the link to a method of running 1000 regressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This also accomplishes a conversion of a wide data set to a long data set, and so this is almost always a good thing to do (see &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 19&lt;/A&gt;). If you created this data set, next time create a long data set which is superior to a wide data set; and even if you received the data this way (i.e. you didn't create it), converting to wide to long is almost always a very good thing to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you seem to keep ignoring other advice: what are you going to do after you saw the woman in half? You really ought to think about that BEFORE you perform all of these analyses and generate all of the outputs and plots.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 21:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764050#M37299</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-25T21:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764058#M37300</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;. Yes, there are many good advice and I really appreciate it!&amp;nbsp; But I still have difficulty in adapting those advice into my own codes. Need some time to digest them. Thank you very much again for your kind help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 21:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764058#M37300</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-25T21:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764160#M37307</link>
      <description>&lt;P&gt;Let me ask a simpler question. Suppose you have only 2 families. You can fit the two regressions and do all the plots, there's no real programming difficulty. And then you have two regressions and two sets of plots (one for each family), then what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you going to do some sort of statistical test? What test?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 11:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764160#M37307</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-26T11:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764169#M37308</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, the codes I attached at the beginning include the tests I need to run. Basically I need to have homogeneity test results, then I do an Lsmean comparison (F-test) between my two treatment groups. But now I have many families that I need to repeat the same. I know there is now BY or macro statement I can choose, but so far, I don't know how to write into my codes to be specific.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data= cecal_family_taxonomy; 
  class treatment block;
  model Family1P = treatment; /*here I have to repeat family2P, 3P...until 800P*/
  random block; 
  random _residual_/group=treatment; 
  lsmeans treatment/tdiff lines;
  covtest homogeneity;
  ods output LSMeans = myparmdataset;
  output out=second predicted=pred residual=resid residual(noblup)=mresid student=sresid student(noblup)=smresid;
  title "1-Taxonomy Data Cecal Family 1 Percentage ANOVA Results";
run;
proc print data=myparmdataset;
format estimate D8.6
       stderr D8.6;
run;
proc print data=second;
run;
proc sgplot data=second;
  scatter y=smresid x=pred;
  refline 0;
run;
proc sgplot data=second;
  scatter y=smresid x=treatment;
  refline 0;
run;
proc sgplot data=second;
  vbox smresid/group=treatment datalabel;
run;
proc sgscatter data=second;
  plot sresid*(pred treatment block);
run;
proc univariate data=second normal plot;
  var sresid;
  histogram sresid / normal kernel;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Aug 2021 12:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764169#M37308</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-26T12:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764171#M37309</link>
      <description>&lt;P&gt;I guess none of this answers my questions, which are not about code, but about how you are going to use the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With regards to the code, the link from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;to an article explaining how to do 1000 regressions gives you a clear example of code on how to do this.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 12:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764171#M37309</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-26T12:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764173#M37310</link>
      <description>&lt;P&gt;My analyses are about gut microbiome. Even though there are large amount of outputs, I have to look through them one by one to see how my positive treatment has an impact on specific bacteria that is under family or species level compared to control group. Even there are over 800 family, I might only find let is say 20 something that have significant differences. Don't know yet.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 12:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764173#M37310</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-26T12:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764185#M37311</link>
      <description>&lt;P&gt;I think I may have been writing code when I should have been asking design questions.&amp;nbsp; Let me know if this is how the study was designed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are N subjects, grouped into M blocks.&amp;nbsp; Subjects within block receive one of two treatments - treated or control.&amp;nbsp; A cecal sample is taken from each subject, and microbiological survey is done on the sample.&amp;nbsp; There could be up to 800 different species/families counted, although it is likely that not all are present in every sample. The counts per family are converted to percentage of total counts.&amp;nbsp; So for any given species/family, you would have N/2 observations in the treated group and N/2 observations in the control group..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that a fair summary of the experimental design?&amp;nbsp; If so, then we need to account for the following in the analysis: Non-independence of the family counts, as they must sum to the total count.&amp;nbsp; Repeated measurement on the cecal samples - counts for each family.&amp;nbsp; A non-normal response variable - either family count/total count (binomial) or family count with an offset of total count (generalized Poisson).&amp;nbsp; I would think that since your denominator is on the order of 10^9 per ml, those two distributions are asymptotically the same.&amp;nbsp; There are up to 800 comparisons between treatment and control, so there is a multiple comparison issue to be handled as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I missing anything critical in the design?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 13:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764185#M37311</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-26T13:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764191#M37313</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/339127"&gt;@kellychan84&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My analyses are about gut microbiome. Even though there are large amount of outputs, I have to look through them one by one to see how my positive treatment has an impact on specific bacteria that is under family or species level compared to control group. Even there are over 800 family, I might only find let is say 20 something that have significant differences. Don't know yet.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you are comparing 800 different families to a control group, you might want to include family in the model itself instead of running 800 separate models, one family at a time.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 13:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764191#M37313</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-26T13:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764239#M37314</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp; your descriptions of my study design are completely correct. I think my experiment design is very simple. Two treatments (1 control and 1 antibiotics), and animals are randomly assigned into two treatments according to RCBD. Now both cecal and fecal samples are collected and are analyzed for microbiota under kingdom, phylum, class, order, family, genus, and species levels. The family, genus, and species levels have so many bacteria that I have to compare them one by one between two treatments. That is the tricky thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The percentage data I have converted through excel and can be uploaded to SAS. I here also include my data input code for your reference.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cecal_family_taxonomy;
  length treatment $20;
  Infile "/home/u39233094/sasuser.v94/Thesis/CSV file/5-family cecal taxonomy for SAS.csv" dlm="," firstobs=5;
  input diet$ treatment$ block pen pig_number Family1 Family1P Family2 Family2P Family3 Family3P Family4 Family4P....Family121P Family122 Family122P TotalR TotalP;     /*species have over 800 bacteria that have to be compared one by one*/                                                                                                                                                                                                                           
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764239#M37314</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-26T15:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764245#M37316</link>
      <description>prepare a macro&lt;BR /&gt;%macro macroname(parameters)&lt;BR /&gt;... your code with parameters referred to as &amp;amp;param_1...&amp;amp;param_2 etc&lt;BR /&gt;%mend;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764245#M37316</guid>
      <dc:creator>MaryA_Marion</dc:creator>
      <dc:date>2021-08-26T15:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764246#M37317</link>
      <description>&lt;P&gt;I think GLIMMIX can not include different families in the same one model? Am I wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764246#M37317</guid>
      <dc:creator>kellychan84</dc:creator>
      <dc:date>2021-08-26T15:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to run the same code for different data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764507#M37336</link>
      <description>&lt;P&gt;Yes GLIMMIX can handle multiple levels of family.&amp;nbsp; There will be missing values, as not every pig will have every taxon group, but that is the sort of thing mixed models are good at handling.&amp;nbsp; However, your main effect means will not be estimable, so you would look at the simple effect of treatment for each taxon group using the SLICE option of the LSMEANS statement for treatment*family.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 17:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-run-the-same-code-for-different-data/m-p/764507#M37336</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-08-27T17:06:23Z</dc:date>
    </item>
  </channel>
</rss>

