This might be quite basic question, but:
Lets say I have a study where reaction times are measured twice before drinking alcohol and twice after drinking specific amount of alcohol, and hypothesis is that alcohol would increase the reaction time.
I have got my data in SPSS in the following format:
id | name| time_a | time_b | time_mean | time_a_alcohol | time_b_alcohol | time_mean_alcohol|
1| john| 0.17| 0.21| 0.19| 0.20| 0.24| 0.22|
2| bob| 0.15| 0.25| 0.20| 0.20| 0.30| 0.35|
I would like to do a independent Samples t-test, which I believe I could do if the data were set as following
id | name| alcohol| time_a | time_b | time_mean|
1| john| 0| 0.17| 0.21| 0.19|
1| john| 1| 0.20| 0.24| 0.22|
2| bob| 0| 0.15| 0.25| 0.20|
2| bob| 1| 0.20| 0.30| 0.25|
Where I could have the alcohol as the grouping value. However, my data isn't in that format as of now, as all of it is in one row.
Is there an option to do in the SPSS with one row so I could "time_mean" and "time_mean_alcohol" grouped without having to put them on two different rows; if not, is there a simple script to write to split the data?
You could calculate those means in the same row (and then run the analysis on them) like this:
compute time_mean=mean(time_a, time_b).
compute time_mean_alcohol=mean(time_a_alcohol, time_b_alcohol).
On the other hand, you can reach the long format as you described using this code:
varstocases /make time_a from time_a time_a_alcohol/make time_b from time_b time_b_alcohol/index=ind(time_a).
compute alcohol=char.index(ind, "alcohol")>0.
compute time_mean=mean(time_a, time_b).
exe.
NOTE: this looks to me like a case for paired-samples test rather than independant samples.