<?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 Add one observation (sample mean) to existing SAS dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65435#M18663</link>
    <description>I want to add one more observation to the exisiting SAS dataset and could not find a good resolution ....&lt;BR /&gt;
&lt;BR /&gt;
I have two variables called X,Y with 1000 observations each. &lt;BR /&gt;
&lt;BR /&gt;
X represents categories (ranging from 0 to 1000 but numbers themselves have no meaning), and Y represents each category's score.&lt;BR /&gt;
&lt;BR /&gt;
I want to add a 1001st row for X that denotes a category that does not appear between 0 and 1000, and assign it the value of sample average of 1000 Y values.&lt;BR /&gt;
&lt;BR /&gt;
So the 1001st row will have: X = 9999, Y=sample average of Y's&lt;BR /&gt;
Thank you!</description>
    <pubDate>Thu, 19 Aug 2010 15:41:53 GMT</pubDate>
    <dc:creator>SAS_user_n</dc:creator>
    <dc:date>2010-08-19T15:41:53Z</dc:date>
    <item>
      <title>Add one observation (sample mean) to existing SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65435#M18663</link>
      <description>I want to add one more observation to the exisiting SAS dataset and could not find a good resolution ....&lt;BR /&gt;
&lt;BR /&gt;
I have two variables called X,Y with 1000 observations each. &lt;BR /&gt;
&lt;BR /&gt;
X represents categories (ranging from 0 to 1000 but numbers themselves have no meaning), and Y represents each category's score.&lt;BR /&gt;
&lt;BR /&gt;
I want to add a 1001st row for X that denotes a category that does not appear between 0 and 1000, and assign it the value of sample average of 1000 Y values.&lt;BR /&gt;
&lt;BR /&gt;
So the 1001st row will have: X = 9999, Y=sample average of Y's&lt;BR /&gt;
Thank you!</description>
      <pubDate>Thu, 19 Aug 2010 15:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65435#M18663</guid>
      <dc:creator>SAS_user_n</dc:creator>
      <dc:date>2010-08-19T15:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add one observation (sample mean) to existing SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65436#M18664</link>
      <description>There are multiple ways to do this. With your small data sets, a variation of the following should work for you.&lt;BR /&gt;
[pre]proc summary data=sashelp.class;&lt;BR /&gt;
   var height;&lt;BR /&gt;
   output out=sumry mean=height;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
data extra(keep=name height);&lt;BR /&gt;
   set sashelp.class(keep=height name) end=eof;&lt;BR /&gt;
   output extra;&lt;BR /&gt;
   if eof then do;&lt;BR /&gt;
      name='Xxxxx';&lt;BR /&gt;
      set sumry;&lt;BR /&gt;
      output extra;&lt;BR /&gt;
   end;&lt;BR /&gt;
   run;[/pre]</description>
      <pubDate>Thu, 19 Aug 2010 16:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65436#M18664</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-08-19T16:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add one observation (sample mean) to existing SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65437#M18665</link>
      <description>Thank you!</description>
      <pubDate>Thu, 19 Aug 2010 17:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-one-observation-sample-mean-to-existing-SAS-dataset/m-p/65437#M18665</guid>
      <dc:creator>SAS_user_n</dc:creator>
      <dc:date>2010-08-19T17:38:28Z</dc:date>
    </item>
  </channel>
</rss>

