SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  SPSS 26 trouble with FUZZY Extension command

    Posted Mon August 17, 2020 01:46 AM

    I am having trouble with propensity score matching on SPSS26. I have the FUZZY extension bundle, but the output says "This procedure requires the FUZZY extension command which is not installed." I have attached the output. I have researched this problem extensively and tried every posted solution to no avail. Any assistance is greatly appreciated.

    * Propensity Score Matching.

    begin program python3.

    import spss, random, spssaux, codecs

    try:

    import FUZZY

    except:

    print("This procedure requires the FUZZY extension command which is not installed.")

    parts = [int(i) for i in FUZZY.__version__.split(".")]

    if parts < [1,3,0]:

    raise EnvironmentError("This procedure requires version 1.3.0 or later of FUZZY")

    ds = spss.ActiveDataset()

    if ds =="*":

    ds = "D" + str(random.random())

    spss.Submit("DATASET NAME " + ds)

    matchgroup = "M" + str(random.random()) #temporary variable

    tempdsname = "D" + str(random.random())

    lrcmd = spssaux.u(r"""LOGISTIC REGRESSION VARIABLES Surgeon_Volume

    /METHOD=ENTER age albumin creatinine ptt pad dm chr_lung_disease ckd chr_liver_disease ast

    /SAVE=PRED(Propensity).""")

    try:

    spss.Submit(lrcmd)

    except:

    raise ValueError("Logistic Regression step failed")

    fuzzycmd = spssaux.u(r"""FUZZY BY=Propensity SUPPLIERID=study_id NEWDEMANDERIDVARS=MATCHID

    GROUP=Surgeon_Volume EXACTPRIORITY=FALSE

    MATCHGROUPVAR=%(matchgroup)s FUZZ=.02 DS3=%(tempdsname)s

    /OPTIONS SAMPLEWITHREPLACEMENT=FALSE MINIMIZEMEMORY=TRUE SHUFFLE=FALSE .

    DELETE VARIABLES %(matchgroup)s.

    DATASET ACTIVATE %(ds)s.

    DELETE VARIABLES %(matchgroup)s.

    DATASET COPY PSM_1.

    DATASET ACTIVATE PSM_1.

    SELECT IF Surgeon_Volume EQ 1.

    DATASET ACTIVATE %(tempdsname)s.

    DATASET ACTIVATE PSM_1.

    ADD FILES /FILE=* /FILE=%(tempdsname)s.

    EXECUTE.

    DATASET CLOSE %(tempdsname)s.""" % locals())

    spss.Submit(fuzzycmd)

    end program.

    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






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: SPSS 26 trouble with FUZZY Extension command

    Posted Mon August 17, 2020 02:44 AM

    To get a more specific error message, run this code from the Syntax Window

    begin program python3.

    import FUZZY

    end program.

    If that doesn't reveal the problem, if you send the data and the pasted syntax, I'll try to see if it is an environmental problem or related to the data. (jkpeckSupport Member)

    And what platform are you on?






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: SPSS 26 trouble with FUZZY Extension command

    Posted Mon August 17, 2020 03:30 AM

    Ok here is the error message I get after running that code.


    Traceback (most recent call last):

     File "<string>", line 2, in <module>

    ImportError: No module named 'FUZZY'


    However, I do have FUZZY installed.

    I am on MacOS


    Thank you for your help.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: SPSS 26 trouble with FUZZY Extension command

    Posted Mon August 17, 2020 12:55 PM

    If FUZZY is present, it appears that it is not on the Python search path. If you run SHOW EXT. from a syntax window, the EXTPATH section shows places that Python will search. See if you can find where FUZZY.py is It should be in one of those places (along with other components such as FUZZY.xml that it requires.)






    #SPSSStatistics
    #Support
    #SupportMigration