<?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 add number of observations to an SGplot? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749369#M235466</link>
    <description>This paper should help you. It gives you 3 ways. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3644-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3644-2019.pdf&lt;/A&gt;</description>
    <pubDate>Mon, 21 Jun 2021 19:44:50 GMT</pubDate>
    <dc:creator>tarheel13</dc:creator>
    <dc:date>2021-06-21T19:44:50Z</dc:date>
    <item>
      <title>How to add number of observations to an SGplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749352#M235451</link>
      <description>&lt;P&gt;Hi, how can you add the number of observations used in an sgplot to a graph. I.e. for the below code, somewhere on the graph, or as a title if easier, I would like it to say "428 observations").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally I'd like something that would change if I added a where statement to the data statement below. I.e. if I said (where=(enginesize&amp;gt;3)) then it would update the observation number in the graph produced to the actual number of relevant observations (obviously less than 428 in this case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sgplot data=sashelp.cars;
  histogram EngineSize / nbins=18;
  density EngineSize;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 18:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749352#M235451</guid>
      <dc:creator>EC27556</dc:creator>
      <dc:date>2021-06-21T18:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add number of observations to an SGplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749362#M235461</link>
      <description>&lt;P&gt;Where do you want it to appear?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 19:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749362#M235461</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-21T19:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add number of observations to an SGplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749369#M235466</link>
      <description>This paper should help you. It gives you 3 ways. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3644-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3644-2019.pdf&lt;/A&gt;</description>
      <pubDate>Mon, 21 Jun 2021 19:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749369#M235466</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-21T19:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add number of observations to an SGplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749371#M235467</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars / view=cars;
set Sashelp.cars;
/* put WHERE clause here, if desired */
WHERE EngineSize &amp;gt; 3;
run;


proc sql noprint; 
select N(EngineSize) into :N trimmed 
from cars; 
quit;

%put &amp;amp;=N;

proc sgplot data=sashelp.cars;
  histogram EngineSize / nbins=18;
  density EngineSize;
  inset "N = &amp;amp;N" / border;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jun 2021 20:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-number-of-observations-to-an-SGplot/m-p/749371#M235467</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-06-21T20:02:14Z</dc:date>
    </item>
  </channel>
</rss>

