SPSS Statistics

 View Only
  • 1.  casestovars usage

    Posted Tue November 09, 2021 05:29 PM

    Hi,

     

    Hope to get help to see what I can't see...

    I am running the attached syntax, which as far as I can tell looks the same, except for the name of the file read. But I get different results. Examples #2 and #3 are what I would expect, one record with the minimum and maximum for each variable in the original file. Example #1 is clearly different form #2 and #3.

     

    Thank you!

     

    E.



    This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


    Thank you for your compliance.




  • 2.  RE: casestovars usage

    Posted Tue November 09, 2021 08:59 PM
    Hi. I see two SAV files. I don't see any syntax files attached.

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



  • 3.  RE: casestovars usage

    Posted Tue November 09, 2021 09:31 PM

    Attached again is the syntax and the results I get.

     

     

     






  • 4.  RE: casestovars usage

    Posted Tue November 09, 2021 09:33 PM

    And here is the syntax embedded within the message.

     

    * Encoding: windows-1252.

    echo "Example #1".

    new file.

    get file = "C:\Temp\PIRLS2016RecodedVars_CatVarStats.sav"

         / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.

     

    echo "Example #2".

    new file.

    get file = "C:\Temp\RecoderPlusSampleResults_CatVarStats.sav"

         / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.

       

    echo "Example #3".

    add files / file = "C:\Temp\PIRLS2016RecodedVars_CatVarStats.sav"

               / file = "C:\Temp\RecoderPlusSampleResults_CatVarStats.sav"

      / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.

     






  • 5.  RE: casestovars usage

    Posted Wed November 10, 2021 03:40 AM
    Hello I also tested, it is very strange :-( with Syntax #1 different output

    * No1 *.

    new file.

    get file = "C:\Temp\PIRLS2016RecodedVars_CatVarStats.sav" / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.



    echo "Example #2".

    new file.

    get file = "C:\Temp\RecoderPlusSampleResults_CatVarStats.sav" / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.



    echo "Example #3".

    dataset close all.

    NEW FILE.

    add files / file = "C:\Temp\PIRLS2016RecodedVars_CatVarStats.sav" / file = "C:\Temp\RecoderPlusSampleResults_CatVarStats.sav" / keep = varname minimum maximum.

    list vars = all.

    sort cases by Varname.

    casestovars index = Varname.

    list vars = all.​​

    ------------------------------
    xiaoqin Oezener-Wan
    ------------------------------



  • 6.  RE: casestovars usage

    Posted Wed November 10, 2021 03:55 AM
    Hello I noticed if the file has only 2 cases, the output will be different 
    only if the file has more than 3 cases, it works fine .

    ------------------------------
    xiaoqin Oezener-Wan
    ------------------------------



  • 7.  RE: casestovars usage

    Posted Wed November 10, 2021 06:12 PM

    I see. Good catch. It also does not work with 1 variable.

    We'll wait to hear from the IBMers to see if this is by design.