Python Extension Commands for SPSS Statistics

IBM® SPSS® Statistics - Essentials for Python, which is installed by default with your IBM SPSS Statistics product, includes a set of extension commands that are implemented in Python and that provide capabilities beyond what is available with built-in SPSS Statistics procedures. Each extension command has an associated dialog box that generates command syntax for the command and is available from the SPSS Statistics menus. The extension commands can also be run from SPSS Statistics command syntax in the same manner as any built-in command such as FREQUENCIES.

Table 1. Listing of Python extension commands
Menu location Command name Description
Data>Case Control Matching FUZZY Perform exact or fuzzy case-control matching.
File>Collect Variable Information GATHERMD Build a dataset of variable information from multiple datasets.
Analyze>Regression>Partial Least Squares PLS Partial least squares regression.
Data>Propensity Score Matching PSM Propensity score matching.
Utilities>Censor Table SPSSINC CENSOR TABLES Censor cells of a pivot table that is based on the values of a test statistic.
Transform>Create Dummy Variables SPSSINC CREATE DUMMIES Create a set of dummy variables that represent the values of a variable.
File>Open>Internet Data SPSSINC GETURI DATA Open an SPSS, Excel, SAS, or Stata dataset from a web url.
Utilities>Process Data Files SPSSINC PROCESS FILES Apply a file of syntax to a set of data files.
Edit>Search Data Files SPSSINC PROCESS FILES SEARCH Search the cases in a set of SPSS Statistics data files.
Data>Rake Weights SPSSINC RAKE Calculate weights to control totals in up to 10 dimensions by rim weighting, that is, raking.
Utilities>Define Variable Macro SPSSINC SELECT VARIABLES Define a macro listing variables selected according to variable dictionary properties.
Data>Split into Files SPSSINC SPLIT DATASET Split a dataset into separate files according to splitting variables.
Analyze>Compare Means>Summary Independent-Samples T Test SPSSINC SUMMARY TTEST Calculate a t test from sample summary information.
Transform>Programmability Transformation SPSSINC TRANS Apply a Python function to case data.
Analyze>Descriptive Statistics>TURF Analysis SPSSINC TURF Perform a TURF (Total Unduplicated Reach and Frequency) analysis.
Data>Adjust String Widths Across Files STATS ADJUST WIDTHS Adjust widths of string variables across files.
Analyze>Correlate>Canonical Correlation STATS CANCORR Calculate canonical correlations.
Analyze>Custom Tables>Define Category Order STATS CATEGORY ORDER Create a macro or multiple dichotomy set with a specified variable order.
Analyze>Classify>Cluster Silhouettes STATS CLUS SIL Compute silhouette measure for cluster analysis.
Graphs>Regression Variable Plots STATS REGRESS PLOT Plots useful in assessing regression relationships.
Graphs>Compare Subgroups STATS SUBGROUP PLOTS Graphically compare the distributions of a set of variables across a partition of the data.
Utilities>Calculate with Pivot Table STATS TABLE CALC Calculate with pivot table cells.
Graphs>Weibull Plot STATS WEIBULL PLOT Create Weibull probability plot for failure data.
Utilities>Create Text Output TEXT Create a text block in the Viewer, optionally with formatted text.

Notes

  • Help for each of the Python extension commands is available by clicking Help on the associated dialog box. The help is not, however, integrated with the SPSS Statistics Help system.
  • Complete syntax help for each of the extension commands is available by positioning the cursor within the command (in a syntax window) and pressing the F1 key. It is also available by running the command and including the /HELP subcommand. For example:
            STATS TABLE CALC /HELP.
    The command syntax help is not, however, integrated with the SPSS Statistics Help system and is not included in the Command Syntax Reference.
    Note: The F1 mechanism for displaying help is not supported in distributed mode.
  • If the menu location that is specified for an extension command is not present in your IBM SPSS Statistics product, then look on the Extensions menu for the associated dialog.
  • The dialogs were created with the Custom Dialog Builder in IBM SPSS Statistics. You can view the design for any of the dialogs and you can customize them using the Custom Dialog Builder. It is available from Extensions>Utilities>Custom Dialog Builder (Compatibility mode).... To view the design for a dialog, choose File>Open Installed from within the Custom Dialog Builder.
  • The implementation code (Python modules) and XML specification files for each of the Python extension commands can be found in the location where extension commands are installed on your computer. To view the location, run the SHOW EXTPATHS syntax command. The output displays a list of locations under the heading "Locations for extension commands". The files are installed to the first writable location in the list.
  • Other extension commands that are not included in IBM SPSS Statistics - Essentials for Python are available for download from the Extension Hub, accessible from Extensions>Extension Hub. The Extension Hub also displays any updates that are available for the extension commands included with IBM SPSS Statistics - Essentials for Python in addition to updates for any other extensions that you installed.
  • If you are installing extensions on SPSS Statistics Server, you can use a script to install multiple extensions at once. For information, see Core System > Extensions> Installing local extension bundles > Batch installation of extension bundles in the Help system.