<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - webonomic</title>
<link>http://snipplr.com/users/webonomic</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 22:12:48 GMT</pubDate>
<item>
<title>(SAS) Co Word Analysis with SAS</title>
<link>http://snipplr.com/view/68863/co-word-analysis-with-sas/</link>
<description><![CDATA[ <p>Text Miner uses a compressed representation of the term-by-doc frequency matrix. You will find an OUT data set in the project data directory of  your text miner run. Its label will include the string "OUT" in it.  Since a 30,000 document collection will have as many as 500,000 to a million distinct terms, be sure to restrict your terms of interest with a start list. I give an example of creating the cooccurrence matrix with the following code which expands the compressed version to an uncompressed version and then computes the co-occurrence count with proc corr and the sscp option.</p> ]]></description>
<pubDate>Sun, 02 Dec 2012 07:43:07 GMT</pubDate>
<guid>http://snipplr.com/view/68863/co-word-analysis-with-sas/</guid>
</item>
<item>
<title>(SAS) Using Alternating Background Color with PROC REPORT</title>
<link>http://snipplr.com/view/68058/using-alternating-background-color-with-proc-report/</link>
<description><![CDATA[ <p>Adding alternating row of color to make proc report output easier to read.</p> ]]></description>
<pubDate>Fri, 02 Nov 2012 02:33:20 GMT</pubDate>
<guid>http://snipplr.com/view/68058/using-alternating-background-color-with-proc-report/</guid>
</item>
<item>
<title>(SAS) Specify colors in SAS statistical graphics procedures</title>
<link>http://snipplr.com/view/67903/specify-colors-in-sas-statistical-graphics-procedures/</link>
<description><![CDATA[ <p>If you want to see some of the color names that SAS recognizes, run the following statements, which will print a list of colors to the SAS log:</p> ]]></description>
<pubDate>Wed, 24 Oct 2012 06:53:06 GMT</pubDate>
<guid>http://snipplr.com/view/67903/specify-colors-in-sas-statistical-graphics-procedures/</guid>
</item>
<item>
<title>(SAS) Default Macro Values</title>
<link>http://snipplr.com/view/67710/default-macro-values/</link>
<description><![CDATA[ <p>Quite often it is necessary to set a default value for a macro parameter that is passed to a program. If the program is a macro, the %IF statement can be used to check if the value is provided and provide a default value if not. Since %IF statements are not allowed outside of macros, that technique won't work for a non-macro program (e.g., a file/program that is %INCLUDEd). The following code snippet demonstrates the use of the COALESCEC function to assign a default value.

since macro is a text manipulation facility, the coalesceC function is used regardless of whether the expected value for the parameter is numeric (i.e., everything in macro is interpretted as a character string).</p> ]]></description>
<pubDate>Sat, 13 Oct 2012 00:28:05 GMT</pubDate>
<guid>http://snipplr.com/view/67710/default-macro-values/</guid>
</item>
<item>
<title>(SAS) Creating a report of Twitter hashtag activity</title>
<link>http://snipplr.com/view/64529/creating-a-report-of-twitter-hashtag-activity/</link>
<description><![CDATA[ <p>The program uses the XML LIBNAME engine, FILENAME URL, SGPLOT procedure, and a simple PROC PRINT to create a report of recent Twitter activity around a specified hashtag.</p> ]]></description>
<pubDate>Fri, 13 Apr 2012 01:02:52 GMT</pubDate>
<guid>http://snipplr.com/view/64529/creating-a-report-of-twitter-hashtag-activity/</guid>
</item>
<item>
<title>(DOS Batch) Combine/append ASCII files using DOS</title>
<link>http://snipplr.com/view/64528/combineappend-ascii-files-using-dos/</link>
<description><![CDATA[ <p>Quickly combine/append ascii type files such as txt or csv.</p> ]]></description>
<pubDate>Fri, 13 Apr 2012 00:53:33 GMT</pubDate>
<guid>http://snipplr.com/view/64528/combineappend-ascii-files-using-dos/</guid>
</item>
<item>
<title>(SAS) Selecting a Random Sample of Observations</title>
<link>http://snipplr.com/view/63355/selecting-a-random-sample-of-observations/</link>
<description><![CDATA[ <p>You can use the POINT option of the SET statement to efficiently select a random sample of observations from a SAS data set. In addiiton to any statistical reasons for drawing a random sample, the technique is also useful to create test data from a large file. The program shown here efficiently samples a large data set.
It reads only the observations that have been selected using the POINT option.
You assign a variable that is the desired sample size. The example here selects a 10% sample. You can also assign a fixed value (e.g., 100).
The DO loop is iterated for each observation
The uniform function is compared to the percent of observations still to be selected
If the observation is selected, it is read and output and the number needed is decremented by 1
Regardless the number of observations left is reduced by 1
The STOP statement is very important as without it, the DATA step will enter an infinite loop.
This technique works by modifying the threshold as observations are read and selected. Every observation has the same probability of being selected so the technique is statistically valid (If you are a statistician, you probably know this. If not, the analogy of drawing straws is the logic behind this.)</p> ]]></description>
<pubDate>Thu, 16 Feb 2012 02:08:13 GMT</pubDate>
<guid>http://snipplr.com/view/63355/selecting-a-random-sample-of-observations/</guid>
</item>
<item>
<title>(SAS) Convert SAS dataset to Text file</title>
<link>http://snipplr.com/view/60841/convert-sas-dataset-to-text-file/</link>
<description><![CDATA[ <p>This SAS macro will convert a dataset to a text file</p> ]]></description>
<pubDate>Tue, 15 Nov 2011 14:20:12 GMT</pubDate>
<guid>http://snipplr.com/view/60841/convert-sas-dataset-to-text-file/</guid>
</item>
<item>
<title>(SAS) Exporting Multiple Data Sets to One Spreadsheet</title>
<link>http://snipplr.com/view/50839/exporting-multiple-data-sets-to-one-spreadsheet/</link>
<description><![CDATA[ <p>It's easy to export several data sets to one Excel spreadsheet with each data set in a separate worksheet.This example exports three SAS data sets (work.region, work.county and work.district) to the same spreadsheet (results.xls).</p> ]]></description>
<pubDate>Sat, 19 Mar 2011 07:32:29 GMT</pubDate>
<guid>http://snipplr.com/view/50839/exporting-multiple-data-sets-to-one-spreadsheet/</guid>
</item>
<item>
<title>(SAS) Store a zero value in place of missing when reporting numeric values</title>
<link>http://snipplr.com/view/47703/store-a-zero-value-in-place-of-missing-when-reporting-numeric-values/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 22 Jan 2011 10:20:23 GMT</pubDate>
<guid>http://snipplr.com/view/47703/store-a-zero-value-in-place-of-missing-when-reporting-numeric-values/</guid>
</item>
<item>
<title>(Ruby) Strip characters from between two delimiters</title>
<link>http://snipplr.com/view/42947/strip-characters-from-between-two-delimiters/</link>
<description><![CDATA[ <p>This regular expression used in Ruby will extract the characters between single or multi-character delimiters.  It helps when you have strange delimiters such as \":delimeter1: text I want to grab goes here :delimiter2:\"</p> ]]></description>
<pubDate>Tue, 26 Oct 2010 04:00:58 GMT</pubDate>
<guid>http://snipplr.com/view/42947/strip-characters-from-between-two-delimiters/</guid>
</item>
<item>
<title>(SAS) Create a new variable based on the first non missing value from a list of variables</title>
<link>http://snipplr.com/view/41119/create-a-new-variable-based-on-the-first-non-missing-value-from-a-list-of-variables/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 29 Sep 2010 02:55:10 GMT</pubDate>
<guid>http://snipplr.com/view/41119/create-a-new-variable-based-on-the-first-non-missing-value-from-a-list-of-variables/</guid>
</item>
<item>
<title>(SAS) Retrieve the physical location of a dynamic dataset, file or folder in SAS</title>
<link>http://snipplr.com/view/28985/retrieve-the-physical-location-of-a-dynamic-dataset-file-or-folder-in-sas/</link>
<description><![CDATA[ <p>The PATHNAME function can be used to retrieve the physical location of a file or directory. This can be especially useful when reassigning engines for a libref using the Macro Language.

Here we want to write a Version 6 copy of the data set CLASS to the same location as the MYDATA library, however in order to issue a new LIBNAME statement we need to know the location of the MYDATA library. The PATHNAME function returns this location and the new libref (MYDAT6) can be created.</p> ]]></description>
<pubDate>Fri, 26 Feb 2010 16:04:44 GMT</pubDate>
<guid>http://snipplr.com/view/28985/retrieve-the-physical-location-of-a-dynamic-dataset-file-or-folder-in-sas/</guid>
</item>
<item>
<title>(Bash) Create ISO files in Linux</title>
<link>http://snipplr.com/view/26623/create-iso-files-in-linux/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 17 Jan 2010 16:22:30 GMT</pubDate>
<guid>http://snipplr.com/view/26623/create-iso-files-in-linux/</guid>
</item>
<item>
<title>(Ruby) Ruby vcard maker</title>
<link>http://snipplr.com/view/26218/ruby-vcard-maker/</link>
<description><![CDATA[ <p>Requires vPim package.</p> ]]></description>
<pubDate>Sun, 10 Jan 2010 13:27:32 GMT</pubDate>
<guid>http://snipplr.com/view/26218/ruby-vcard-maker/</guid>
</item>
<item>
<title>(Ruby) Ruby script to save a string to a file.</title>
<link>http://snipplr.com/view/26217/ruby-script-to-save-a-string-to-a-file/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 10 Jan 2010 13:23:39 GMT</pubDate>
<guid>http://snipplr.com/view/26217/ruby-script-to-save-a-string-to-a-file/</guid>
</item>
<item>
<title>(Bash) Send email using mail command on linux</title>
<link>http://snipplr.com/view/24239/send-email-using-mail-command-on-linux/</link>
<description><![CDATA[ <p>This command will email the contents of emailbody.txt to somebody@domain.com with the subject My subject line.</p> ]]></description>
<pubDate>Thu, 03 Dec 2009 23:56:13 GMT</pubDate>
<guid>http://snipplr.com/view/24239/send-email-using-mail-command-on-linux/</guid>
</item>
<item>
<title>(Bash) Loop through Array in Bash</title>
<link>http://snipplr.com/view/24230/loop-through-array-in-bash/</link>
<description><![CDATA[ <p>This creates an array of various linux shell names, loops through the array and ouputs a file called shell_locations.txt showing where the shells are located on the linux system.</p> ]]></description>
<pubDate>Thu, 03 Dec 2009 20:45:39 GMT</pubDate>
<guid>http://snipplr.com/view/24230/loop-through-array-in-bash/</guid>
</item>
<item>
<title>(SAS) Show all possible values in table regardless of whether or not the value exists</title>
<link>http://snipplr.com/view/18831/show-all-possible-values-in-table-regardless-of-whether-or-not-the-value-exists/</link>
<description><![CDATA[ <p>Here are two solutions when creating a table to show responses to a questionnaire where respondents rate items in various categories.  In this case, the responses range from 0 to 5 (N/A, Very Poor, Poor, Average, Good, Very Good).</p> ]]></description>
<pubDate>Tue, 25 Aug 2009 13:19:46 GMT</pubDate>
<guid>http://snipplr.com/view/18831/show-all-possible-values-in-table-regardless-of-whether-or-not-the-value-exists/</guid>
</item>
<item>
<title>(Bash) Backup your MBR on Linux</title>
<link>http://snipplr.com/view/13173/backup-your-mbr-on-linux/</link>
<description><![CDATA[ <p>About the dd command:

dd if= of= bs=("USUALLY" some power of 2, not less than 512 bytes(ie, 512, 1024, 2048, 4096, 8192, 16384[/b], but can be ANY reasonable number.) skip= seek= conv=.

Source is the data being read. Target is where the data gets written.

Warning!! If you reverse the source and target, you can wipe out a lot of data. This feature has inspired the nickname "dd" Data Destroyer.
Warning!! Caution should be observed when using dd to duplicate encrypted partitions.</p> ]]></description>
<pubDate>Tue, 17 Mar 2009 00:11:55 GMT</pubDate>
<guid>http://snipplr.com/view/13173/backup-your-mbr-on-linux/</guid>
</item>
</channel>
</rss>