SPSS Statistics

 View Only
  • 1.  Weighting by using the python rake module

    Posted Tue April 27, 2021 06:32 AM
    Dear all,
    with the old SPSS V22 installation I always used the python rake module (SPSSINC_RAKE extension) to compute weight variables.
    After migrating to V27 this module seems no longer existent and I have to use the rake procedure from the SPSS menu i.e. the syntax for that.
    Now, I am wondering if it is no longer possible to use SPSSINC_RAKE.
    Does anyone know something about that?
    Best regards
    Alexander

    ------------------------------
    Alexander Mentrup
    (r)evolution GmbH
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Weighting by using the python rake module

    Posted Tue April 27, 2021 07:47 AM
    Alexander;

    RAKE is not a "native" SPSS procedure; it remains the Python module, its code updated for Python 3.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: Weighting by using the python rake module

    Posted Tue April 27, 2021 07:56 AM
    Hi Rick,
    thanks for the quick response.
    Where can I get the updated code for Py3? Usually I use something like the following within SPSS syntax.

    begin program.
    import spss, spssaux, rake
    rake.rake(['jobcat','gender','mind'],[{1:.95, 2:.025,3:.025,-99:0.0}, {1:.50, 2:.50}, {0:.25,1:.75}], finalweight='wt', visible=True)
    end program.

    ------------------------------
    Alexander Mentrup
    (r)evolution GmbH
    ------------------------------



  • 4.  RE: Weighting by using the python rake module

    Posted Tue April 27, 2021 08:06 AM
    Edited by System Fri January 20, 2023 04:29 PM
    In the Extensions menu, select Extension Hub. Enter RAKE in the search field, then click Apply, then the little box on the right that says "Get extension." That enables "OK" at the bottom.

    Proceed from there.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 5.  RE: Weighting by using the python rake module

    IBM Champion
    Posted Tue April 27, 2021 09:35 AM
    The SPSSINC RAKE extension command replaced the direct Python code you cited, and it has some extended functionality and a dialog box interface that will appear after you install it from the Extension Hub as Rick said as well as regular SPSS-style syntax.

    You might be able to run the rake function inside SPSSINC_RAKE.py, but you are much better off using the extension with SPSS syntax.

    ------------------------------
    Jon Peck
    ------------------------------