<?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: Aggregating dataset to an upper level in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Aggregating-dataset-to-an-upper-level/m-p/574904#M28247</link>
    <description>&lt;P&gt;I would use PROC SUMMARY and not PROC SQL to do this, but in either case, in order to advise you properly, we would need to see a small portion of your input data set, provided according to these directions: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2019 10:56:39 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-07-19T10:56:39Z</dc:date>
    <item>
      <title>Aggregating dataset to an upper level</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Aggregating-dataset-to-an-upper-level/m-p/574706#M28242</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset of students within classrooms within schools. I am trying to create a dataset that is at the class level from the student level file (i.e. aggregate student scores - 1 variables for one classroom).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created all my aggregated classroom variables with the following code (retaining student variables only at the class level, teacher variables which are by nature at the class level, and upper school level variables only):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table teacher_is as&lt;BR /&gt;select x_idschool, x_class_id, t_selprog, t_female, t_sel,&lt;BR /&gt;mean(js_Sel) as js_sel_c, mean (j_int) as j_int_c, mean (j_ext) as j_ext_c,&lt;BR /&gt;mean (j_pared2) as j_pared2_c, mean (s_ageyrs) as age_c, mean(s_female) as fem_c,&lt;BR /&gt;TSSA11, TSSA14, TSSA19, TSSA111, TSSA113,&lt;BR /&gt;t_grade, t_imm, t_nonwhite,&lt;BR /&gt;t_com_elem6_12, t_ef,t_std_behav, t_clasS_pbs, t_sel_mean,&lt;BR /&gt;js_Sel_m, t_selprog_m, median, enrol, sch_lvl_Sec&lt;BR /&gt;from is_agg&lt;BR /&gt;group by x_idschool, x_class_id;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, my output dataset still has a sample size at the student level. In SPSS you can aggregate up - whereby you have one observation for one class. Is there a way to do this in SAS?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jillian&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 18:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Aggregating-dataset-to-an-upper-level/m-p/574706#M28242</guid>
      <dc:creator>halladje</dc:creator>
      <dc:date>2019-07-18T18:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset to an upper level</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Aggregating-dataset-to-an-upper-level/m-p/574904#M28247</link>
      <description>&lt;P&gt;I would use PROC SUMMARY and not PROC SQL to do this, but in either case, in order to advise you properly, we would need to see a small portion of your input data set, provided according to these directions: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 10:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Aggregating-dataset-to-an-upper-level/m-p/574904#M28247</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-19T10:56:39Z</dc:date>
    </item>
  </channel>
</rss>

