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  

One of my frustrations with programmability is the learning barrier.  On the one hand, the resources and capabilities available through Python programmability combined with the plug-in for PASW Statistics are tremendous.  Often a problem can be solved in a few lines of Python code that would take a page of code in PASW Statistics or be practically impossible.  On the other, the Python language is very different from the Statistics syntax language, so many of those who would benefit from the capabilities Python brings to Statistics are frustrated.  Python is an easy language to learn, but it’s a programming language, and many of our users are not programmers.

Read more

Bookmark and Share
Print This Post   Email This Post  

The Output Translator

Posted By Jon Peck on Jun 29, 2009 at 08:06 PM
Filed Under Python, SPSS Statistics v17, Uncategorized | 1 Comment 

Although SPSS translates the user interface and output to many languages, there is often a need for some output in other languages.  The translator package provides tools for user-created translations.

Read more

Bookmark and Share
Print This Post   Email This Post  

We Have Moved

Posted By Jon Peck on Jun 12, 2009 at 01:06 PM
Filed Under Developer Central News | Leave a Comment 

The blog site hosting has changed.  Previously the site was hosted externally.  Now it is actually on the SPSS servers.  We also have a link to this page on Developer Central, and we will include  newsworthy items about Developer Central in these blogs.

The most recent Devcentral additions are

  • The 64-bit version of the I/O dll for Windows has been posted.  It provides a way for applications to read and write the SPSS sav file with requiring PASW Statistics or other SPSS software to be installed.
  • There is a new extension command and possible autoscript available for translating Viewer output.  The package is SPSSINC TRANSLATE OUTPUT.  I’ll write about it soon as it has some interesting features, but the download includes a document with all the details.
  • A user-contributed dialog for poly correlations based on the R polycor package.  It is similar to SPSSINC HETCOR, but it isn’t an extension command, and it includes some interesting graphics.
  • Bug fix in the FUZZY extension command for cases where more than one match is requested for each case.
Bookmark and Share
Print This Post   Email This Post  

Next Page →