SPSS Statistics

Expand all | Collapse all

How to do within-subject analysis with two datasets (pre and post)

  • 1.  How to do within-subject analysis with two datasets (pre and post)

    Posted Thu October 28, 2021 09:34 AM
    I thought I posted this earlier but I can't see it so apologies if it appears twice. 

    I am trying to figure out how to do a within-subject analysis when the data is split over two datasets. I have pre- and post- measures, with an ID code for each person. I have figured out how to merge by cases (which allows me to do a straight comparison of all pre- vs all post scores. I have merged by variables, using ID Code as the key variable, but the Post- data still appears as new cases below the pre- data (although the variables are added). If that's all that is meant to happen, is there a way of carrying out analysis such that I can calculate the difference in scores for each individual? 

    Thanks.

    ------------------------------
    Carly Butler
    ------------------------------


  • 2.  RE: How to do within-subject analysis with two datasets (pre and post)

    Posted Fri October 29, 2021 09:51 AM
    Hello 

    you need to rename the same variable in the first or second file before you merge them 

    get file = myfile_first.

    rename myvar = myvar_first. 

    merge files file = */table = second/by id. 

    compute diff = myvar_first - myvar. 


    regards,

    ------------------------------
    xq
    ------------------------------