SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  Why SPSS Rake is not working

    Posted Fri July 23, 2021 10:40 PM

    Hi, When i run SPSS Rake on my laptop it doesn't seem to work, nothing happens. However when i ask a colleague to run my syntax on their laptop (these are all work laptops with v25 SPSS installed) it works fine. To me these seems like a issue with the add-ons required to run it, however Python Essentials is loaded when SPSS v25 was installed (i have had it re-installed twice now) and i have advanced statistics as part of the SPSS Licence. So i am unsure why this is happening.

    I tried reducing the code to just use 1 rim, and that made no difference, so i do not think it is an issue with the laptop working hard to find a solution.

    Syntax below

    DATASET ACTIVATE CostaRicaImputed.

    Weight by DesignWeightTelephone.

    SPSSINC RAKE

    DIM1 = AgebyGender 1 0.098976 2 0.126261 3 0.095443 4 0.084086 5 0.052215 6 0.027258 7 0.017489 8 0.091820 9 0.121757 10 0.095824 11 0.085131 12 0.053636 13 0.028730 14 0.021367

    DIM2=HHSize 1 0.1123 2 0.427 3 0.4608

    DIM3=Education 1 0.573655 2 0.200856 3 0.225487

    DIM4=WorkStatus 1 0.499985 2 0.500014

    DIM5=Region 1 0.345706 2 0.194590 3 0.110776 4 0.103655 5 0.072780 6 0.090942 7 0.081548

    FINALWEIGHT=Weight

    /OPTIONS ITERATIONS=100 CONVERGENCE=.0001 DELTA=.5 SHOW=YES

    /PLOT HISTOGRAM=YES AUTOHEATMAP=2.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Why SPSS Rake is not working

    Posted Fri July 23, 2021 10:48 PM

    If there was a problem with the syntax or the Python extension support, you would at least get some output or complaints.

    Try running this code in a syntax window to see if the Python Essentials are working.

    begin program python3.

    import spss

    print(spss)

    import SPSSINC_RAKE

    print(SPSSINC_RAKE)

    end program.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Why SPSS Rake is not working

    Posted Sat July 24, 2021 07:29 AM

    Hi Jon, i tried that and then running the Rake command again and same problem, nothing happening

    begin program python3.

    import spss

    print(spss)

    import SPSSINC_RAKE

    print(SPSSINC_RAKE)

    end program.

    Weight by DesignWeightTelephone.

    SPSSINC RAKE

    DIM1 = AgebyGender 1 0.098976 2 0.126261 3 0.095443 4 0.084086 5 0.052215 6 0.027258 7 0.017489 8 0.091820 9 0.121757 10 0.095824 11 0.085131 12 0.053636 13 0.028730 14 0.021367

    DIM2=HHSize 1 0.1123 2 0.427 3 0.4608

    DIM3=Education 1 0.573655 2 0.200856 3 0.225487

    DIM4=WorkStatus 1 0.499985 2 0.500014

    DIM5=Region 1 0.345706 2 0.194590 3 0.110776 4 0.103655 5 0.072780 6 0.090942 7 0.081548

    FINALWEIGHT=Weight

    /OPTIONS ITERATIONS=100 CONVERGENCE=.0001 DELTA=.5 SHOW=YES

    /PLOT HISTOGRAM=YES AUTOHEATMAP=2.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Why SPSS Rake is not working

    Posted Sat July 24, 2021 07:34 AM

    Just to add the copy and paste is from the output window, not the syntax window.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Why SPSS Rake is not working

    Posted Sat July 24, 2021 12:53 PM

    So you got no output from the begin program block?

    If you check the Variable View, did you also not see the new weight variable Weight?

    If the weight variable is actually present, then the problem is with getting the output to the Viewer. If not, then the procedure probably did not run.

    One more thing to try considering the possibility that the Viewer output was blocked somehow.

    Run this.

    oms /destination outfile="c:/temp/output.pdf" format=pdf.

    <your rake command>

    omsend.

    Change the output location as appropriate on your system.

    If you got anything in the pdf file, which is created by the backend rather than through the Viewer, then there may be a problem with the temporary directory used for transmitting programmability output.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Why SPSS Rake is not working

    Posted Mon July 26, 2021 09:30 AM

    Hi i do get a PDF document in the temp folder and in the PDF i simply get the syntax as per below.


    SPSSINC RAKE DIM1 = AgebyGender 1 0.098976 2 0.126261 3 0.095443 4 0.084086 5 0.052215 6 0.027258 7 0.017489 8 0.091820 9 0.121757 10 0.095824 11 0.08513 1 12 0.053636 13 0.028730 14 0.021367 DIM2=HHSize 1 0.1123 2 0.427 3 0.4608 DIM3=Education 1 0.573655 2 0.200856 3 0.225487 DIM4=WorkStatus 1 0.499985 2 0.500014 DIM5=Region 1 0.345706 2 0.194590 3 0.110776 4 0.103655 5 0.072780 6 0.090942 7 0.081548 FINALWEIGHT=Weight /OPTIONS ITERATIONS=100 CONVERGENCE=.0001 DELTA=.5 SHOW=YES /PLOT HISTOGRAM=YES AUTOHEATMAP=2. omsend.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: Why SPSS Rake is not working

    Posted Mon July 26, 2021 01:16 PM

    It seems that no programmability code is running. Running this code

    begin program python3.

    import spss

    print(spss)

    import SPSSINC_RAKE

    print(SPSSINC_RAKE)

    end program.

    should at least display where the RAKE module is being loaded from. If you get no output, there is a problem with the programmability connection that nothing to do with RAKE in particular. Unfortunately, I can't diagnose that. Sorry. Maybe Technical Support can help you.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 8.  RE: Why SPSS Rake is not working

    Posted Tue July 27, 2021 06:47 PM

    Hi Jon,


    i might have found the issue...


    I think there may be an error in the spssdxcfg.ini file


    To test this, in SPSS, I started a new script from File > New

    > Script > Python 3


    This will start the SPSS’s python shell


    then i entered:


    >>> help('spss')


    problem in spss - ParsingError: Source contains parsing

    errors: 'C:\\PROGRA~2\\IBM\\SPSS\\STATIS~1\\25\\spssdxcfg.ini'

                   

    [line  9]: '=25.0.0.2\n'



    Near the top of this file in C:\Program Files

    (x86)\IBM\SPSS\Statistics\25\ spssdxcfg.ini I have

    [version]

    ;

    The version of Statistics

    ;

    You should not change the version number, otherwise SPSS-Python package may not

    function properly.

    SpssdxVersion=25.0

    SpssdxVersionMajor=25

    SpssdxVersionMinor=0

    =25.0.0.2

    SpssdxFixPack=2


    When I try to run SPSSINC_RAKE.py on the SPSS installed

    python version I get the ParsingError as SPSSINC_RAKE.py want to load the spssmodule and fails there.


    What I do not know is if the Rake command actually runs the

    SPSSINC_RAKE.py or if it solely relies on the SPSSINC_RAKE.spe file.

    If it does run the actual SPSSINC_RAKE.py file, then

    that will be the most likely cause of it not working.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 9.  RE: Why SPSS Rake is not working

    Posted Tue July 27, 2021 07:12 PM

    I can't tell whether the lines were wrapped by this site or the file is wrong, but I have V25 on another computer, and the ini file looks like this. I have R support installed also, but you don't need that for RAKE.


    [version]

    ; The version of Statistics

    ; You should not change the version number, otherwise SPSS-Python package may not function properly.

    SpssdxVersion=25.0

    SpssdxVersionMajor=25

    SpssdxVersionMinor=0

    SpssdxFixPack=2


    [SUPPORTED_LANG]

    X=R;PYTHON;PYTHON2;PYTHON3


    [EXTENSION]

    EXTENSION_SERVER_URL_1=https://www.ibm.com/developerworks/community/files/basic/anonymous/api/collection/23c2eac7-e524-4393-a4b9-0d224a2a0eda/feed?

    [Python]

    HOME=

    LIB_NAME=InvokePython

    [Python3]

    HOME=

    LIB_NAME=InvokePython34

    [R]

    HOME=c:\r3.3

    LIB_NAME=InvokeR


    Try removing that =25.0.0.2 line. I presume that your ini file has additional lines below what you posted. If not, that would be another problem that you fix using my file.


    As for the second part, Statistics will try to run the SPSSINC_RAKE.py file if it gets that far, but the ini problem will probably cause it to stop before it even gets to that.

    The spe file is like a zip file and holds all the files needed by the extension. Running the extension, though, does not actually refer to that file.






    #SPSSStatistics
    #Support
    #SupportMigration