Permutation Method Example: Dolphin Therapy

A 2005 study looked at whether swimming with Dolphins for two weeks in Honduras was more beneficial for patients with clinical depression than swimming a similar amount in Honduras, but without dolpins. A group of 30 volunteers with clinical depression were randomly assigned to either swim with dolphins, or to swim without. After two weeks, they were tested to see if their symptoms of depression had improved.

dolphinData = matrix(c(10,3,5,12),ncol=2,byrow=T)
colnames(dolphinData)=c('Dolphin Therapy','Control Group')
rownames(dolphinData)=c('Depression Improved','Did not improve')
dolphinData
##                     Dolphin Therapy Control Group
## Depression Improved              10             3
## Did not improve                   5            12
barplot(dolphinData,legend=T)

Permutation Test

Imagine that 13 of our subjects were going to improve, no matter what. Dolphin therapy had no effect. This basically describes our null hypothesis: dolphin therapy is no different than the control for improving depression symptoms. So if we have these 13 people who will improve, we can simulate how likely it is for 10 of them to end up in the dolphin group.

simulatedResults = c()
patients = c(rep(1,13),rep(0,17)) # This vector represents 13 people who will improve and 17 who won't.
for (i in 1:5000) {
  dolphinGroup =sample(patients,15) # This is a simulated group of patients who have been randomly assigned to the dolphin group.
  simulatedResults = c(simulatedResults,sum(dolphinGroup))
}
hist(simulatedResults,col='gray',xlab='# of patients in the dolphin group whose symptoms improve')

Our actual experiment had 10 people in the actual dolphin group improve. Here is how often we got results that were as extreme or more in the simulation:

sum(simulatedResults>=10)
## [1] 62

Since the simulation had 5000 iterations, divide the sum above by 5000 to get a p-value of 0.0124.