# One group, four conditions and six tests. Testing the effect of altitude

I'm testing the effect of four different altitudes (0m, 1000m, 2000m and 3000m) on repeated sprint performance (6 sprints at each altitude). I have 8 test subjects who will be tested at each altitude. That means I'm getting 8x4x6=192 sets of data. What I want to investigate is the difference in performance at the 4 different altitudes and wether or not there actually IS a difference. How do I best represent this and what would be the relevant statistical tests to run? To me it is a bit confusing since I have multiple conditions, and I want to compare each condition with the other conditions (but I'm not sure about the best way to do this).

Thanks in advance for your help. Let me know if I can clarify.

You need repeated measures analysis. You need one variable for the subject (lets say “subject” with values 1 to 8) one more variable to express the altitude (lets say “altitude” with values 0, 1, 2, 3) and one per sprint repeat (lets say “sprint1”, “sprint2”, ..., “sprint6”).

So, your data will have 8 variables with 32 values each (8 subjects to 4 different altitudes). Now, it is a nice idea to type in the data in Excel or Calc in the above format and save in a separate file (8 columns and 32 rows).

For the statistical analysis: In case you are using SPSS then you need to copy and paste the data from Excel or Calc to SPSS and use the procedure provided in Analyze → General Linear Model → Repeated Measure. You may find many nice tutorials in the web.

In case you are using R project then first type in your data using the following commands

subject = as.factor(c(1, 1, 1, 1, 2, 2, 2, 2, ….. , 8, 8, 8, 8))
altitude = as.factor(c(0, 1, 2, 3, 0, 1, 2, 3,  ….. ,0, 1, 2, 3))
sprint1 = c(time 1 for subject 1 and altitude 0,  …., time 1 for subject 8 and altitude 3)
....
sprint6 = c(time 6 for subject 1 and altitude 0,  …., time 6 for subject 8 and altitude 3)

dataF = data.frame(subject, altitude, sprint1, sprint2, sprint3, sprint4, sprint5, sprint6)


Then, define the time factor

time = factor(rep("sprint_time_measurement", 6), levels=c("sprint1", "sprint2", "sprint3", "sprint4", "sprint5", "sprint6"))
time[1] = "sprint1"; time[2] = "sprint2"; time[3] = "sprint3";time[4] = "sprint4";time[5] = "sprint5";time[6] = "sprint6"
idata <- data.frame(time)


And, finally run the analysis with the following commands

mod.ok <- lm(cbind(sprint1, sprint2, sprint3, sprint4, sprint5, sprint6) ~  subject * altitude, data=dataF)
library(car)
(av.ok <- Anova(mod.ok, idata=idata, idesign=~time, type = "III"))
summary(av.ok, multivariate=FALSE)


Normally, the above will provide the necessary output for you. The type = "III" option is not necessary, keep it if you need to have similar to the default SPSS output (however keep in mind that this is not necessarily the correct choice)

The first thing you will look is for the interaction between the three factors (time, subject, altitude). If not significant interaction appear then look to the partial interactions between each two factors and if no significant interactions appear then look into the effects of each factor separately.

If interaction is significant then the rest analysis is a little bit complicated. For SPSS you should use the syntax editor (the procedure described here) while for R, I would suggest (with some caution since I never did that) the lmdme (other suggestions are welcome!)