<?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 &amp;quot;Split Data&amp;quot; (By Group Processing) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926283#M46070</link>
    <description>&lt;P&gt;Paul, Nice to hear from you but, while my name is attached to it, I don't think I wrote the post to which you were replying. I never got into incorporating hash into my code like you, Don, Richard and Kilovolt did. However, as I mentioned in response to another post in this thread, I haven't used SAS in years and am simply enjoying retirement. On a different note, I think that Montreal was the first global forum I ever attended. You bring back a bunch of memories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 12:20:33 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2024-04-29T12:20:33Z</dc:date>
    <item>
      <title>How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431439#M22691</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have googled similar questions but could not find answers that I can understand. So here I am asking for your help!&lt;/P&gt;&lt;P&gt;What I want to know is &lt;STRONG&gt;how to get results separately in a group. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example (just copied and pasted from Excel)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; Weight Treatment kcal&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;400&lt;BR /&gt;2&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;3&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;560&lt;BR /&gt;4&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;BR /&gt;5&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;490&lt;BR /&gt;6&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;7&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;400&lt;BR /&gt;8&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;700&lt;BR /&gt;9&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;900&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;580&lt;BR /&gt;2&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;600&lt;BR /&gt;3&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;BR /&gt;4&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;5&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;600&lt;BR /&gt;6&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;BR /&gt;7&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;700&lt;BR /&gt;8&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;9&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;780&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;570&lt;BR /&gt;2&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;670&lt;BR /&gt;3&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;570&lt;BR /&gt;4&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;400&lt;BR /&gt;5&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;600&lt;BR /&gt;6&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;BR /&gt;7&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;BR /&gt;8&amp;nbsp;&amp;nbsp; &amp;nbsp;OW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;500&lt;BR /&gt;9&amp;nbsp;&amp;nbsp; &amp;nbsp;NW&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;800&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, I am going to run one-way repeated measures ANOVA to see if there is a treatment effect (A, B, C) on subsequent calorie intake (kcal). However, I want to see the result separately for each body weight status (NW=normal weight &amp;amp; OW=overweight). Please ignore the small sample size because this is just an example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In SPSS, we can "split file" and then get results for both NW and OW separately in any analysis conducted after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am an absolute beginner of SAS and have never edited the code. Just importing excel files for each analysis and selecting some commands. Therefore, I'd appreciate if you could explain in a comprehensive way if it involves code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431439#M22691</guid>
      <dc:creator>madpumpkinpie</dc:creator>
      <dc:date>2018-01-26T20:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431441#M22692</link>
      <description>&lt;P&gt;First, there's no need to split anything here ... no need to split the dataset ... no need to split the analysis; in fact, splitting the analysis would be the wrong thing to do from a statistical point of view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm;
    class weight treatment;
    model kcal=weight|treatment;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Optionally you may want an LSMEANS statement.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431441#M22692</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-26T20:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431447#M22693</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; a class act.&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/189486"&gt;@madpumpkinpie&lt;/a&gt;&amp;nbsp;just in case, if you need for other purposes in future&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID $  Weight $ Treatment $ kcal;
datalines;
1    NW    A    400
2    NW    A    500
3    OW    A    560
4    NW    A    800
5    OW    A    490
6    NW    A    500
7    OW    A    400
8    OW    A    700
9    NW    A    900
1    NW    B    580
2    NW    B    600
3    OW    B    800
4    NW    B    500
5    OW    B    600
6    NW    B    800
7    OW    B    700
8    OW    B    500
9    NW    B    780
1    NW    C    570
2    NW    C    670
3    OW    C    570
4    NW    C    400
5    OW    C    600
6    NW    C    800
7    OW    C    800
8    OW    C    500
9    NW    C    800
;
proc sort date=have;
by weight;
run;
data _null_;
if _n_=1 then do;
if 0 then set have;
 dcl hash h(dataset:'have(obs=0)',multidata:'y');
 h.definekey('Weight');
 h.definedata(all:'y');
 h.definedone();
 end;
 set have;
 by weight;
 if first.weight then h.clear();
 h.add();
 if last.weight then h.output(dataset: weight);
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431447#M22693</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-26T20:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431481#M22694</link>
      <description>&lt;P&gt;Thank you for replying!&lt;/P&gt;&lt;P&gt;I understand what you mean, but then how can I compare the effect of treatment on food intake between NW and OW participants? It's because I found significant treatment effect in NW group (n=41) but not in OW group (n=12) when I ran One-way repeated measures ANOVA for each body weight group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what is this code for? Where to be put?&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;glm&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;weight&lt;/SPAN&gt; treatment&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; kcal&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;weight&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;treatment&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank you,&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 22:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431481#M22694</guid>
      <dc:creator>madpumpkinpie</dc:creator>
      <dc:date>2018-01-26T22:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431482#M22695</link>
      <description>&lt;P&gt;Thank you for replying!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this code include both the command for splitting file and running ANOVA?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 22:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431482#M22695</guid>
      <dc:creator>madpumpkinpie</dc:creator>
      <dc:date>2018-01-26T22:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431484#M22696</link>
      <description>&lt;P&gt;Nope Anova, funny enough, i have just enrolled for statistics courses as a full time student &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; The code just splits. Sorry about that&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 22:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431484#M22696</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-26T22:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431537#M22697</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189486"&gt;@madpumpkinpie&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for replying!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this code include both the command for splitting file and running ANOVA?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, as I said, there is no need to do any splitting when you do an ANOVA.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 15:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431537#M22697</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-27T15:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431539#M22698</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry, but I don't get why no need of split...:(&amp;nbsp;&amp;nbsp;Could you explain?&lt;/P&gt;&lt;P&gt;Then if I want to see the separate result of the effect of treatment on calorie intake for different weight status, may I conduct one-way ANOVA twice (one for NW group and the other one for OW group)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 15:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431539#M22698</guid>
      <dc:creator>madpumpkinpie</dc:creator>
      <dc:date>2018-01-27T15:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431544#M22699</link>
      <description>&lt;P&gt;You conduct one ANOVA, where the effect of treatment and the effect of weight are both in the model. Splitting the data and conducting an ANOVA for OW and another ANOVA for NW is the wrong thing to do, statistically.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;From this one analysis, you can determine the effect of treatment for the OW case, and a different effect of treatment for the NW case.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 17:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431544#M22699</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-27T17:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431570#M22700</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189486"&gt;@madpumpkinpie&lt;/a&gt;: Just wanted to point out a couple of things. First, I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, if you're doing the analysis to test hypotheses, the correct method is to use a single analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, so that you gain a better understanding of how SAS works, you could still get exactly what you asked for without having to "split" the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g.,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;recommended:&lt;/P&gt;
&lt;PRE&gt;proc glm data=have;
    class weight treatment;
    model kcal=weight|treatment;
run;
&lt;/PRE&gt;
&lt;P&gt;To do the same thing, separately for each level of treatment,&amp;nbsp;one could use:&lt;/P&gt;
&lt;PRE&gt;proc sort data=have;
  by treatment;
run;

proc glm data=have;
    class weight;
    by treatment;
    model kcal=weight;
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;: While splitting the data isn't needed to solve the problem, this question was cross-posted on SAS-L&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;(i.e., Paul Dorfman) pointed out that no sort is needed when using the hash object to split such a file. I ran a test comparing your method with the one that Paul suggested, and I totally have to agree with him. He suggested:&lt;/P&gt;
&lt;PRE&gt;data _null_ ; 
  dcl hash x() ; 
  x.defineKey ('weight') ; 
  x.defineData ('weight','h') ; 
  x.defineDone () ; 
  dcl hash h ; 
  do until (z) ; 
    set have end = z ; 
    if x.find() ne 0 then do ; 
      h = _new_ hash (dataset:'have(obs=0)', multidata:'y') ;
      h.defineKey ('weight') ; 
      h.defineData (all:'y') ; 
      h.defineDone () ; 
      x.add() ; 
    end ; 
    h.add() ; 
  end ; 
  dcl hiter i('x') ; 
  do while (i.next()=0) ; 
    h.output (dataset: weight) ; 
  end ; 
  stop ; 
run ; 
&lt;/PRE&gt;
&lt;P&gt;Your solution would only be (very) slightly faster IF the data were already sorted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2018 00:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431570#M22700</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-28T00:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431571#M22701</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;for even filling me in such amazing discussions. It's really a privilege although makes me very nervous to participate when you champs and your contemporaries do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, i have tried another 9.4 method avoiding sort:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID $  Weight $ Treatment $ kcal;
datalines;
1    NW    A    400
2    NW    A    500
3    OW    A    560
4    NW    A    800
5    OW    A    490
6    NW    A    500
7    OW    A    400
8    OW    A    700
9    NW    A    900
1    NW    B    580
2    NW    B    600
3    OW    B    800
4    NW    B    500
5    OW    B    600
6    NW    B    800
7    OW    B    700
8    OW    B    500
9    NW    B    780
1    NW    C    570
2    NW    C    670
3    OW    C    570
4    NW    C    400
5    OW    C    600
6    NW    C    800
7    OW    C    800
8    OW    C    500
9    NW    C    800
;


data _null_;
if _n_=1 then do;
if 0 then set have;
 dcl hash h(dataset:'have',multidata:'y');
 h.definekey('Weight');
 h.definedata(all:'y');
 h.definedone();
 dcl hash h1(dataset:'have',duplicate:'r');
 h1.definekey('Weight');
 h1.definedata('weight');
 h1.definedone();
 dcl hiter i('h1') ; 
 dcl hash h2(dataset:'have(obs=0)',multidata:'y');
 h2.definekey('Weight');
 h2.definedata(all:'y');
 h2.definedone();
 end;
rc = i.first();
do while (rc = 0);
	h2.clear();
   do while(h.do_over(key:weight) eq 0);
    h2.add();
 	end;
	h2.output(dataset:weight);	
	 rc = i.next();
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2018 00:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431571#M22701</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-28T00:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431600#M22702</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189486"&gt;@madpumpkinpie&lt;/a&gt;: Just wanted to point out a couple of things. First, I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, if you're doing the analysis to test hypotheses, the correct method is to use a single analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, so that you gain a better understanding of how SAS works, you could still get exactly what you asked for without having to "split" the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g.,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;recommended:&lt;/P&gt;
&lt;PRE&gt;proc glm data=have;
    class weight treatment;
    model kcal=weight|treatment;
run;
&lt;/PRE&gt;
&lt;P&gt;To do the same thing, separately for each level of treatment,&amp;nbsp;one could use:&lt;/P&gt;
&lt;PRE&gt;proc sort data=have;
  by treatment;
run;

proc glm data=have;
    class weight;
    by treatment;
    model kcal=weight;
run;
&lt;/PRE&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well I feel that I should point out that this is NOT the same thing. The F-tests will be different; and thus correct if you don't split the analysis using BY groups, and incorrect if you do split the analysis by using BY groups.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2018 12:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431600#M22702</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-28T12:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431610#M22703</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;: Poor choice of words on my part. I didn't mean to imply that the by group analyses were either correct of supplied the same result. I'm well familiar with the effects (particularly on alpha) of doing multiple tests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My post was simply to address the question that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189486"&gt;@madpumpkinpie&lt;/a&gt;&amp;nbsp;originally asked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Conversely, if one isn't doing hypothesis testing, but rather&amp;nbsp;only&amp;nbsp;data snooping (however frowned upon that may be), the approach does exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2018 14:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/431610#M22703</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-28T14:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926253#M46064</link>
      <description>&lt;P&gt;Art,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just need to point out that this method was invented by Richard A. DeVenezia. In fact, the whole idea of storing hash object references in another hash object has come from his SAS-L post following SUGI in Montreal where Koen Vyverman and I did the first user-created SUGI presentation on the SAS hash object unveiled by SAS in 2003. During the aftertalk Q&amp;amp;A someone (sorry, don't remember who) asked if a hash object could contain other hash objects as data. I did not think so - and replied accordingly.&lt;/P&gt;
&lt;P&gt;A few days after the conference Richard posted a message on SAS-L where he demonstrated that not only that HOH (hash-of-hashes) was possible but how to use it in conjunction with the hash iterator to split an unsorted file. Basically, with this post alone, Richard laid the foundation of HOH and a practical example sufficient for anyone with a couple of hash crevices to expand its usage way beyond the task of file splitting. Later on, HOH has become a major part of the hash object book Don Henderson and I published in 2018.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 04:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926253#M46064</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2024-04-29T04:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926272#M46067</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OT but given you still use&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;Art, CEO, AnalystFinder.com&lt;/EM&gt;: Can you please verify this URL. It appears to me it got hijacked.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926272#M46067</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-29T10:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926277#M46069</link>
      <description>&lt;P&gt;Sorry, I haven't used SAS in years and I no longer own the domain (or company) AnalystFinder.com. In fact, I don't even recall participating in the post that you're asking about. It looks like someone else used my logon to participate. However, at my age, memory is no longer as good as it used to be, so I may have participated and simply forgotten.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 11:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926277#M46069</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2024-04-29T11:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926283#M46070</link>
      <description>&lt;P&gt;Paul, Nice to hear from you but, while my name is attached to it, I don't think I wrote the post to which you were replying. I never got into incorporating hash into my code like you, Don, Richard and Kilovolt did. However, as I mentioned in response to another post in this thread, I haven't used SAS in years and am simply enjoying retirement. On a different note, I think that Montreal was the first global forum I ever attended. You bring back a bunch of memories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 12:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926283#M46070</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2024-04-29T12:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926392#M46079</link>
      <description>Nice to hear from you, too, Art. I remember our interactions, both online and face to face, rather fondly. &lt;BR /&gt;Best regards&lt;BR /&gt;Paul</description>
      <pubDate>Mon, 29 Apr 2024 20:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926392#M46079</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2024-04-29T20:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926401#M46080</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; &lt;BR /&gt;&lt;BR /&gt;Arthur.T,&lt;BR /&gt;Long time no see !&lt;BR /&gt;Did you see Perter.E in recently years ?</description>
      <pubDate>Tue, 30 Apr 2024 01:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926401#M46080</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-04-30T01:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to "Split Data" (By Group Processing)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926471#M46083</link>
      <description>KSharp, Long time no see or hear. I also have not seen or been in contact with Peter for some years now. If you want, you could always try to reach him via his LinkedIn page, namely:&lt;A href="https://www.linkedin.com/in/petereberhardt/?originalSubdomain=ca" target="_blank"&gt;https://www.linkedin.com/in/petereberhardt/?originalSubdomain=ca&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Apr 2024 14:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-quot-Split-Data-quot-By-Group-Processing/m-p/926471#M46083</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2024-04-30T14:24:03Z</dc:date>
    </item>
  </channel>
</rss>

