SPSS Statistics

 View Only
  • 1.  Process Survey Data in Long Form

    Posted Mon August 02, 2021 03:44 PM

    I've collected behavioral (reaction time) & survey data via E-Prime and have exported the data to SPSS. I have syntax to process my reaction time (RT) data: eliminate outliers, average across blocks of trials, etc. to get what I need from the RT data, but I have no idea how to work with survey data in long form. I need to be able to reverse code some questions of the survey data and take a sum or average of the questions. I've figured out a work around to reverse code the questions I need, but I cannot figure out how to take an average of the questionnaire when it is in long form.

    When I try to restructure or transpose my data, I end up with 18676 variables for a single survey that has only 12 questions. I assume because of the large amount of (mostly useless) data that E-Prime has collected and exported. I'm sure I can reduce this number of variables by selecting what E-Prime exports, but I do not think this will fully solve my problem.

    I can restructure my RT data, because I process it to end up with means so there's the same value for the long variable that I care about, but I don't know how to end up with the same result for my surveys.

    It's been a while since I've worked with SPSS much, so forgive me if I'm missing something obvious! Let me know if more information would help answer my question.



    ------------------------------
    Heidi Blocker
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Process Survey Data in Long Form

    Posted Mon August 02, 2021 03:53 PM
    Not sure exactly what you mean by "average of the questionnaire" but for starters I will suggest (if you haven't already considered them) that you consider the SUM and/or MEAN functions, which will work across variables within each case.

    Rick M
    Statistics Quality Assurance






  • 3.  RE: Process Survey Data in Long Form

    IBM Champion
    Posted Mon August 02, 2021 03:57 PM
    You might start by deleting those useless variables. I don't know E-Prime, but I have seen similar junk from Qualtrics.
    But what is wrong with using long form with the regular tools such as DESCRIPTIVES?  If you need within-case means and such, look at MEAN() and such for COMPUTE.  You can even  use TO in their arguments.

    If you need more selection  in these functions, the  SPSSINC SELECT VARIABLES can help.



    --





  • 4.  RE: Process Survey Data in Long Form

    Posted Mon August 02, 2021 04:38 PM
      |   view attached
    I think it'll help if I upload a sample dataset. In this sample dataset I have the data in long form from two participants with their answers to 3 surveys: Belief in a Dangerous World (BDW), Self-Esteem (SE) and Need to Belong (NTB). The variable ____.Sample is the specific question participants answered in that survey. So BDW.SAMPLE 1 indicates it's question #1 and BDWResponse. RSP s their response to question #1, and so on.

    I've used this syntax to try to average across the BDW responses, but since the variable is in long form, it just spits out the exact same number for each row for the participant, so it's not say averaging across row #11-22 (where participant #159's responses to the BDW survey are located in the SPSS file. Which makes sense that it doesn't do that, but that is essentially what I want it to do for each participant.
    USE ALL.
    COMPUTE BDW_Total=MEAN(BDWResponse.RESP).
    EXECUTE.

    I've attached my sample data set with the survey answers. Note, even with this extremely simplified dataset I still end up with extra empty variables when I restructure it. Maybe that's normal?

    Thank you.​​​​

    ------------------------------
    Heidi Blocker
    ------------------------------

    Attachment(s)



  • 5.  RE: Process Survey Data in Long Form

    Posted Mon August 02, 2021 04:53 PM
    Edited by System Fri January 20, 2023 04:42 PM
    I am beginning to see. At least one issue is that the same case spans multiple records. This sounds like a job for C2V (CASESTOVARS), and I think you mentioned that you tried that and got a ton of variables. mostly missing.

    SORT CASES BY Subject.
    CASESTOVARS /ID=Subject /GROUPBY=VARIABLE.​

    Still, as Jon (I think) implied, you can selectively choose the variables that you need to average across. You can also use the DELETE VARIABLES command (which uses TO) to get rid of variables that you know you don't want.

    DELETE VARIABLES ExperimentCondition TO NTBList.Sample.
    SORT CASES BY Subject.
    CASESTOVARS /ID=Subject /GROUPBY=VARIABLE.

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



  • 6.  RE: Process Survey Data in Long Form

    IBM Champion
    Posted Mon August 02, 2021 05:20 PM
    I am not sure what computation you want to do, but maybe you could do AGGREGATE followed by a sum like this.

    AGGREGATE
      /OUTFILE=* MODE=ADDVARIABLES
      /BREAK=Subject
      /BDWResponse.RESP_sum=SUM(BDWResponse.RESP) 
      /SEResponse.RESP_sum=SUM(SEResponse.RESP) 
      /NTBResponse.RESP_sum=SUM(NTBResponse.RESP).

    You could use multiple break variables if needed.

    --





  • 7.  RE: Process Survey Data in Long Form

    Posted Mon August 02, 2021 06:07 PM
    Thank you so much!!! This is exactly what I was looking for. I realize now that my other code for processing the RT data is using the aggregate function, but since I adapted this code from somewhere else (and 5 years ago), I didn't realize that this was exactly what the aggregate function did. Now I can just restructure using the sum variables (and deleting all the extra stuff). When I have the sum variables created by the aggregate function, then restructure works without creating all of those useless variables. 

    Thank you so much!

    ------------------------------
    Heidi Blocker
    ------------------------------