<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Statskom</title>
	<atom:link href="http://statskom.com/tag/histogram/feed/" rel="self" type="application/rss+xml" />
	<link>http://statskom.com</link>
	<description>Clinical programming</description>
	<lastBuildDate>Thu, 05 Oct 2017 09:04:02 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>SAS tips &amp; tricks #4 – Visualising SAS datasets with an sql histogram</title>
		<link>http://statskom.com/sas-tips-tricks-4-visualising-datasets-sql-histogram/</link>
		<comments>http://statskom.com/sas-tips-tricks-4-visualising-datasets-sql-histogram/#comments</comments>
		<pubDate>Thu, 28 Aug 2014 14:52:18 +0000</pubDate>
		<dc:creator><![CDATA[Andrew N]]></dc:creator>
				<category><![CDATA[SAS Tips & Tricks]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[PROC SQL]]></category>
		<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://statskom.com/?p=276</guid>
		<description><![CDATA[<p>In our last post SAS tips &#38; tricks #3 – SAS dictionary tables, we looked at how the dictionary tables can be used to find metadata about the SAS session, including dataset and variable level metadata. In this post we&#8230; </p><p>The post <a rel="nofollow" href="http://statskom.com/sas-tips-tricks-4-visualising-datasets-sql-histogram/">SAS tips &#038; tricks #4 – Visualising SAS datasets with an sql histogram</a> appeared first on <a rel="nofollow" href="http://statskom.com">Statskom</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>In our last post <a title="SAS tips &amp; tricks #3 – SAS dictionary tables" href="http://statskom.com/sas-tips-tricks-3-sas-dictionary-tables/">SAS tips &amp; tricks #3 – SAS dictionary tables</a>, we looked at how the dictionary tables can be used to find metadata about the SAS session, including dataset and variable level metadata.</p>
<p>In this post we look at how we can use a simple piece of SQL to create a histogram which gives a quick overview of the number of variables in each domain.</p>
<p>The SASHELP.VCOLUMN dataset contains a list of all variables present in each dataset. Here we use the repeat function to output a &#8220;*&#8221; character for each variable in the dataset. The output of the query is printed to the active output destination.</p>
<pre>PROC SQL;
   SELECT memname  , REPEAT('*',nvar) AS freq
   FROM sashelp.vtable
   WHERE libname = "SASHELP";
 QUIT;</pre>
<p>The result is something similar to the below, which gives a quick insight into the number of variables in each dataset in the SASHELP library.</p>
<p><a href="http://statskom.com/wp-content/uploads/2014/08/sql_histogram_vars.jpg"><img class="alignnone size-full wp-image-284" alt="sql_histogram_vars" src="http://statskom.com/wp-content/uploads/2014/08/sql_histogram_vars.jpg" width="531" height="706" /></a></p>
<p>This SQL histogram technique has a wide varierty of other applications, for example here we use it to show the frequency of countries within each region in the SASHELP.DEMOGRAPHICS dataset.</p>
<p>&nbsp;</p>
<pre>PROC SQL;
  SELECT region , REPEAT('*',COUNT(*)) AS freq
  FROM sashelp.demographics
  GROUP BY region
  ORDER BY region;
QUIT;</pre>
<p><a href="http://statskom.com/wp-content/uploads/2014/08/sql_histogram_region.jpg"><img class="alignnone  wp-image-283" alt="sql_histogram_region" src="http://statskom.com/wp-content/uploads/2014/08/sql_histogram_region.jpg" width="673" height="117" /></a></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="http://statskom.com/sas-tips-tricks-4-visualising-datasets-sql-histogram/">SAS tips &#038; tricks #4 – Visualising SAS datasets with an sql histogram</a> appeared first on <a rel="nofollow" href="http://statskom.com">Statskom</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://statskom.com/sas-tips-tricks-4-visualising-datasets-sql-histogram/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
