# Data formatting for an ANCOVA in SPSS

was wondering if someone could help clarify an ANCOVA for me, or maybe post me in the right direction.

I have a set of outcome measures that have been administered pre treatment and post treatment. I do not have a control group. My data is in a long format (i.e. each individual has data on 2 rows, one for pre treatment one for post treatment).

I want to do an ANCOVA with baseline scores as a covariate. Time is my fixed factor. I've been told to have my data in the long format (by someone quite senior), but I'm wondering whether I need to transform it into wide format, and then use outcome score as my DV.

I'm using SPSS for the analysis.

Broadly, data can be formatted in "long" format (in which each "person" can have multiple rows) or "wide" format (in which each "person" can have only one row).

When data are in long format, you must differentiate observations from the same person through the values in another variable. So, in repeated measures data where you measure var at three time points, you might have a time variable to tell you what makes the three measures on var from the same person different from each other. Here is an example:

id time        var
1    1  1.3178821
1    2 -0.5910276
1    3  2.2601515
2    1 -0.2065183
2    2 -0.5657661
2    3 -0.9088965
3    1 -1.6664465
3    2  0.7458109
3    3 -0.7942371


When data are in wide format, column names play the role that the time variable once did. So, instead of having three columns named var for the three observations on var from the same person, you need to name your three variables var1, var2, and var3. Here are the same data that I showed above in wide format:

id       var1       var2       var3
1  1.3178821 -0.5910276  2.2601515
2 -0.2065183 -0.5657661 -0.9088965
3 -1.6664465  0.7458109 -0.7942371


The benefit of long format data is that this formatting is very intuitive, allows for unequal spacing between whatever variable is used to differentiate the measurements on var (i.e., I could have used values of $1$, $2$, and $5$ instead of $1$, $2$, and $3$), and allows for different variable values for different people (i.e., person 1 could have had the values of $4$, $5$, and $6$, while everyone else could have had $1$, $2$, and $3$). The benefit of wide format data is that it is more compact, at least in the situations where you can use this formatting.

Different software packages require different data formats. In general, software packages specialized for multi-level modeling require long format data, while standard linear model / regression packages require wide format data. So, yes, you should format your data in wide format to conduct your ANCOVA.