IBM SPSS Syntax for File Operations - Perficient Blogs
Blog
  • Topics
  • Industries
  • Partners

Explore

Topics

Industries

Partners

IBM SPSS Syntax for File Operations

banner1

My start-up predictive analytics organization “Predictive Performers” wants to do some internal planning. We receive extract files from an an accounting service each month that provide the total hours billed per each of our consultants, along with each consultants hourly rate. The files are saved to a folder on our network:

networklocation

The files also breakout my “on staff” consultants as “fte=1”, so it would be interesting to see what we can compare between our full time analytic experts and our contractors.

fileJan

MATCH and AGGREGATE

Using SPSS Syntax, a simple script can be used to automate the merging of these monthly files into a single “quarterly file” and then run a simple aggregation on the file producing some interesting results for the quarter. The script below uses the GET FILE to identify and sort each montly file, then MATCH FILES to perform the merging and finally AGGREGATE to produce some statistics.

aggregationsyntax

In this Syntax script, I’ve output the results to a merged quarter “aggregation” file that gives us a mean and median hourly rate by month for FTE’s and contractors. It also gives us a median for “total hours billed”:

aggregationfile

Here are the 2 new files – the “a” version contains the aggregated results.

finalfiles

Conclusion

Working your way through the SPSS Statistic menus gets old fast. This (very) simple example is an example of the efficiency and control that Syntax provides.

Remember “Scripts over Menus”!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up

Categories