SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  Error in Propensity Score Matching

    Posted Thu March 04, 2021 08:32 PM

    Good afternoon,

    In the past, I've run PSM in SPSS 27 with no issues. However, today, the logistic regression runs fine, and a propensity score is created, but my screen goes dark briefly, and I receive the following set of error messages:

    Messages

    Warnings

    <built-in function GetCaseValue> returned a result with an error set

    Warnings

    Unknown dataset D0.8502790462509824.

    Execution of this command stops.

    Dataset Activate

    Warnings

    Expecting word or = sign. Found DataSet1.

    Execution of this command stops.

    Delete Variables

    Warnings

    Text: M0.9752614089783803 Command: DELETE VARIABLES

    An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables. Check spelling and verify the existence of this variable.

    Execution of this command stops.

    Dataset Activate

    Warnings

    Unknown dataset D0.8037624739974759.

    Execution of this command stops.

    Error # 61 in column 25. Text: D0.8037624739974759

    The filename is not valid.

    Execution of this command stops.

    Note # 5145

    The working file has been restored, and subsequent commands may access the

    working file.

    Dataset Close

    [PSM1]

    Warnings

    Unrecognized dataset name D0.8037624739974759.

    Execution of this command stops.

    Traceback (most recent call last):

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

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spss\spss.py", line 1508, in Submit

    raise SpssError(error)

    spss.errMsg.SpssError: [errLevel 3] Serious error.

    Fuzzy and PSM have been installed and updated, but I am uncertain why the error. Please advise. Thank you.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Error in Propensity Score Matching

    Posted Thu March 04, 2021 09:20 PM

    I haven't seen that error before. Is there something unusual about your data? If you haven't installed the fixpack for V27, that would be a good place to start.

    If you want to send me the syntax (paste from dialog box) and the data, I can investigate (jkpeckSupport Member)






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Error in Propensity Score Matching

    Posted Thu March 04, 2021 09:46 PM

    Thank you for your quick reply.  The data contain protected health information on prison inmates, so I am unable to release it outside of my agency.  ​I will install the fix pack and determine whether the solves the problem, and also investigate if there are unusual patterns in the data. 






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Error in Propensity Score Matching

    Posted Fri March 05, 2021 03:51 AM

    Since you can't send the data, here are a few suggestions that might provide some clues.

    • try running PLS without saving any datasets or selectively saving to see if we can tell where the error is coming from

    try running this code to see if the problem is occurring in reading the data from SPSS

    begin program python3.

    import spssdata


    curs =spssdata.Spssdata()

    for case in curs:

    print(case[0])

    curs.CClose()

    end program.


    If you got a traceback with the error message, post that.








    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Error in Propensity Score Matching

    Posted Fri March 05, 2021 08:18 PM

    Here is what running the code generates:


    Warning: An open Cursor was

    detected while exiting a program block. The Cursor has been closed.

    Traceback (most recent call last): File "<string>", line 4, in <module> 

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spssdata\spssdata.py",

    line 716, in __iter__

    row = self.fetchone()

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spssdata\spssdata.py",

    line 666, in fetchone

    row = self.cur.fetchone()

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spss\cursors.py",

    line 1184, in fetchone

    data = self.binaryStream.fetchData()

     file "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spss\binarystream.py",

    line 410, in fetchData

    activeCase = self.readcache(data)

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spss\binarystream.py",

    line 328, in readcache

    currentcase = self.unpackdata(binaryData)

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\PYTHON3\Lib\site-packages\spss\binarystream.py",

    line 132, in unpackdata

    case[i] = str(case[i], encoding='utf-8')

    UnicodeDecodeError: 'utf-8' codec

    can't decode byte 0x93 in position 0: invalid start byte

     






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Error in Propensity Score Matching

    Posted Fri March 05, 2021 08:29 PM

    If you haven't already gotten this version, install PLS from here

    https://1drv.ms/u/s!AoWcE61g_FAdisIdnggsYvcuNuCMDQ?e=JBJ5l1

    I fixed a bug in PLS introduced with the Python 3 conversion, but I don't know whether that fix made it to the Extension Hub.

    Also, are you running Statistics in Unicode mode? If not, try that.






    #SPSSStatistics
    #Support
    #SupportMigration