#Position attention interaction---- rm(list = ls()) library(ggplot2) library(reshape) data = read.csv2("/.../Position attention interaction.csv") data$Difference_pain_behaviours = NULL data_plot=melt(data, id = "Observer_ID") attach(data_plot) ggplot(data_plot,aes(x=variable,y=value))+geom_boxplot() attach(data) t.test(Position_pain-50) t.test(Attention_pain-50) t.test(Interaction_pain-50) #Place aversion tests---- rm(list = ls()) library(ggplot2) data = read.csv2("/.../Place aversion tests.csv") attach(data) ggplot(data,aes(x=factor(Session),y=Time_pain))+geom_boxplot() t.test(subset(data,Session==1)$Time_pain-50) t.test(subset(data,Session==2)$Time_pain-50) t.test(subset(data,Session==3)$Time_pain-50) #Pain behaviours---- #Position attention interaction---- rm(list = ls()) data = read.csv2("/.../Position attention interaction.csv") attach(data) t.test(data$Difference_pain_behaviours) cor.test(Difference_pain_behaviours,Position_pain) cor.test(Difference_pain_behaviours,Attention_pain) cor.test(Difference_pain_behaviours,Interaction_pain) #place aversion tests---- rm(list = ls()) data = read.csv2("/.../Place aversion tests.csv") attach(data) ggplot(data,aes(x=Difference_pain_behaviours,y=Time_pain))+geom_point()+geom_smooth(method="lm") cor.test(Difference_pain_behaviours,Time_pain)