IBM Support

Propensity score matching PSM not working in SPSS 27 and Python 3: receive error "FUZZY is not defined"

Troubleshooting


Problem

You work with IBM SPSS Statistics 27 on a Windows or Macintosh computer. You would like to perform Propensity Score Matching PSM with embedded Python 3
Embedded Python 3 is enabled on Edit - Options - File Location tab.
You open your data file and select Data - Propensity Matching dialog. After you defined your model you click on OK.
On output viewer you see no output.
Instead you see below error:
  This procedure requires the FUZZY extension command which is not installed.   Traceback (most recent call last):     File "<string>", line 7, in <module>   NameError: name 'FUZZY' is not defined  
image 5045

Cause


This issue is caused by a problem with Python 3 plugin, and this issue only occurs when running the first extension command is PSM. For example if you run any other extension before PSM you will not get the FUZZY error.
Also, a public interim Fix was created to solve this issue. The interim fix can be downloaded from IBM FixCentral as Interim Fix 27.0-IM-S27STATC-WIN64-MACOSX-IF002.zip to be used on Windows and Macintosh Operating systems for release SPSS Statistics 27.
Please see the readme text file included on the zip file on how to apply the interim fix.
APAR PH27340: https://www.ibm.com/support/pages/apar/PH27340

Resolving The Problem


This issue is caused by a problem with Python 3 plugin, and this issue only occurs when running the first extension command is PSM. For example if you run any other extension before PSM you will not get the FUZZY error.
Also, a public interim Fix was created to solve this issue. The interim fix can be downloaded from IBM FixCentral as Interim Fix 27.0-IM-S27STATC-WIN64-MACOSX-IF002.zip to be used on Windows and Macintosh Operating systems for release SPSS Statistics 27.
Please see the readme text file included on the zip file on how to apply the interim fix.
APAR PH27340: https://www.ibm.com/support/pages/apar/PH27340

Other Workarounds for this issue are:
1. Run any other extension command before you run PSM
for example run below command on a new syntax window:
    FUZZY / help.  
OR
2. Run following syntax before execute PSM extension:
For Windows:
 
  BEGIN PROGRAM PYTHON3.  import sys  sys.path.insert(0, r"C:\ProgramData\IBM\SPSS\Statistics\27\extensions")  END PROGRAM.  
For Mac OSX:
  BEGIN PROGRAM PYTHON3.  import sys  sys.path.insert(0, r"/Applications/IBM SPSS Statistics 27/Resources/Extensions/extensions")  END PROGRAM.      
After that, run your PSM model either via dialog or syntax and you no longer will get the FUZZY error.
Example:
image 5046
 image 5047
 PLEASE NOTE:
If you still get an error like the below when you run a PSM model you need to update the installed Extensions FUZZY and PSM.
image 5053
To do so close IBM SPSS Statistics 27.
When on Windows go to C:\Program Files\IBM\SPSS\Statistics\27 installation directory. Right click on stats.exe and select "run as administrator, this will launch the application so that you can make changes.
image 5048

After IBM SPSS Statistics 27 is launched click on Extensions – Extensions dialog

Select the “Installed “tab

You should see updates are available for FUZZY and PSM extensions:

image 5049

Click on “Select” checkbox and the on “Get update” and click OK

image 5050

On next screen accept the license agreement and click on Finish button.

In SPSS 27 you should get information that the 2 extensions are updated

image 5051

On output Viewer you should see a message like the below:

image 5052
After that, run your PSM model regularly.

Document Location

Worldwide

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"27.0.0","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Product Synonym

SPSS; Stats

Document Information

Modified date:
13 July 2020

UID

ibm16245704