The IDLE IDE (Integrated Development Environment) is installed with the Python language and can be used with SPSS, but I am often asked to recommend a better one.  I’ll tell you what I do and offer some tips on using it with IBM SPSS Statistics.  This is not an in-depth review of any of these editors.

Read more

Bookmark and Share
Print This Post   Email This Post  

IBM SPSS Statistics contains many tools for data management.  This post discusses several different ways to solve an example data management problem using technology from different areas of the product.  The purpose of this post is to help you decide where to look when creating a problem solution considering the available functionality and other characteristics.

The problem to be solved here is to convert a text file of comma-separated id values such as postal codes into an SPSS dataset with one item per line.  This might then be used as a lookup table.

Read more

Bookmark and Share
Print This Post   Email This Post  

IBM SPSS Statistics provides several mechanisms for looping in transformations or over groups within a procedure.  The new extension commands expand the looping capabilities.

Read more

Technorati Tags: IBM SPSS Statistics

Bookmark and Share
Print This Post   Email This Post  

Python programs written to run in BEGIN PROGRAM blocks are easy to write and add lots of functionality to IBM SPSS Statistics.  Many users have learned to create these. More users, though, do not know the Python language.

The extension command mechanism provides a way for users of traditional SPSS syntax to run Python programs written by someone else without needing any knowledge of Python.  But the program must have been written as an extension command.  While creating extension commands isn’t hard, it does require some extra knowledge and work.  (An article on how to do this is available on Developer Central.)

I have posted a new extension command, SPSSINC PROGRAM, that allows ordinary Python programs to be run with traditional syntax without the author having created an extension command: easy on the author and easy on the user.

Read more

Bookmark and Share
Print This Post   Email This Post  

I have posted to SPSS Developer Central a new Python-based extension command, SPSSINC SUMMARY TTEST, that does t tests when you have only the summary statistics from the samples rather than the full data.  Besides being useful in its own right, it illustrates some useful techniques in doing programmability computations where you need both scalar computations and some SPSS transformation functions.

Read more

Bookmark and Share
Print This Post   Email This Post  

The Python language includes a general mechanism facilitating translation of text in Python code.  The newest version of extension.py, the module that facilitates creating extension commands, exploits this to make output translation really simple.

Read more

Bookmark and Share
Print This Post   Email This Post  

I have posted new versions of the SPSSINC MODIFY TABLES and SPSSINC MODIFY OUTPUT extension command dialog boxes to Developer Central.  Functionality is unchanged, but the dialogs have been redesigned.

Read more

Bookmark and Share
Print This Post   Email This Post  

Custom dialog boxes (created with the Custom Dialog Builder) can be installed interactively from the IBM SPSS Statistics Utilities menu (Install Custom Dialog in Version 17 or Custom Dialogs>Install Custom Dialog in Version 18).  This works fine, but if you have a lot of dialogs to install or need to do this on many computers, it gets rather tedious.  Fortunately you can automate this process with a simple bat file.  Here’s how.

Read more

Bookmark and Share
Print This Post   Email This Post  

Well, now that SPSS is part of IBM, I suppose we will need a new name for Developer Central and this blog.  In the meantime, though, here is news about recent items on Developer Central.

  • With the release of Version 18 of IBM SPSS Statistics and the Developer product, easy-to-install versions of the Python and R materials are posted.  In particular, look for the R Essentials link on the main page or from the Plugins page.  It installs the R Plugin, the correct version of R, and a bunch of example R integrations as bundles.  It’s much easier to get going with this now.
  • The spssaux2 module has a new function, setMacrosFromData that reads columns in the active dataset and creates macro definitions from them.
  • The SPSSINC TRANS extension command is available.  It makes it easy to run a standard or user-written Python function to transform the case data just about the way you would if the function were built in to the regular SPSS transformation system.  (I’ve written about that in an earlier posting here.)
  • In connection with this, the extendedTransforms.py module has several new functions and some tweaks to make it work well with SPSSINC TRANS.  The new functions are mode and multmode for calculating the mode across variables within a case, packDummies and extractDummies for packing values of dummy variables into bits of a single variable and extracting them out later, and translatechar for mapping a set of characters in a string into another set of characters.
  • Albert-Jan Roskam has contributed a module named state.py that will prune unused variables out of a dataset.
  • The SPSSINC MERGE TABLES and SPSSINC CENSOR TABLES extension commands now run much faster.  (I profiled them and found a few scripting apis that were unexpectedly slow and changed the code to minimize their use).  If you have V18 the speedup is even greater, taking advantage of some improvements in that version.  MERGE TABLES also has some convenience tweaks that make it easier to merge significance tests from Custom Tables into the main table.  V18 has another way to do this built into the CTABLES command, but some people prefer the older style of the tables.
  • The SPSSINC TRANSLATE OUTPUT command is available.  It provides a framework for translating the outline and pivot table text for languages where we don’t already provide a translation.
  • The customstylefunctions module included with the SPSSINC MODIFY TABLES extension command has some new custom functions.  You can now move around rows, columns, and layers by using moveRowDimension, transpose, moveLayersToColumns, moveLayersToRows, moveColumnsToLayers, moveRowsToLayers, moveColumnsToRows, and moveRowsToColumns.
  • The Programming and Data Management book and the article on writing extension commands have been updated for version 18.

All of this material is free once you have the SPSS base product.

Bookmark and Share
Print This Post   Email This Post  

In my last post I wrote about my new extension command, SPSSINC TRANS.  That command makes it very easy to apply Python functions to the case data by handling all the data passing, variable creation, etc, so you just have to write one line of Python code to call the function.

I have now posted a substantial rework of the initial beta version.  As the saying goes, plan to throw one away: you will anyway.  The difficult part of designing and implementing this command was getting the Python function expression through the SPSS Universal Parser, which doesn’t speak Python, and then taking it apart and setting up the requisite connections with the data.

Read more

Bookmark and Share
Print This Post   Email This Post  

Next Page →